Update babel config
This commit is contained in:
parent
c7aa431e4a
commit
c7fb545096
3 changed files with 22 additions and 195 deletions
19
babel.config.js
Normal file
19
babel.config.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module.exports = api => {
|
||||
const isTest = api.env('test');
|
||||
const preset = ["@babel/preset-env"];
|
||||
const testPreset = ["@babel/preset-env", {targets: {node: 'current'}}];
|
||||
|
||||
const plugins = [
|
||||
"@babel/plugin-transform-runtime",
|
||||
"@babel/plugin-syntax-dynamic-import",
|
||||
"@babel/plugin-transform-react-jsx",
|
||||
"@babel/plugin-syntax-function-bind",
|
||||
"@babel/plugin-proposal-function-bind",
|
||||
"@babel/plugin-proposal-class-properties"
|
||||
]
|
||||
|
||||
return {
|
||||
"presets": [isTest ? testPreset: preset],
|
||||
"plugins": plugins
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue