Created
September 14, 2019 12:42
-
-
Save gtzilla/a6ae9777a987df1ee1357df51bf9cd61 to your computer and use it in GitHub Desktop.
An example of the new babel.config.js.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
/** | |
babel.config.js with useful plugins. | |
*/ | |
module.exports = function(api) { | |
api.cache(true); | |
api.assertVersion("^7.4.5"); | |
const presets = [ | |
[ | |
"@babel/preset-env", { | |
"targets": { | |
"esmodules": true, | |
"node":true | |
} | |
} | |
] | |
]; | |
const plugins = [ | |
['@babel/plugin-transform-modules-commonjs'], | |
['@babel/plugin-transform-destructuring'], | |
['@babel/plugin-proposal-class-properties'], | |
['@babel/plugin-proposal-decorators',{ | |
'decoratorsBeforeExport':true | |
}], | |
['@babel/plugin-proposal-export-default-from'], | |
['@babel/plugin-proposal-export-namespace-from'], | |
['@babel/plugin-proposal-object-rest-spread'], | |
['@babel/plugin-transform-template-literals'], | |
['@babel/plugin-proposal-pipeline-operator',{"proposal":"minimal"}], | |
['@babel/plugin-transform-runtime'], | |
['@babel/plugin-transform-classes'] | |
]; | |
return { | |
presets, | |
plugins | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment