Updated babel configuration
This commit is contained in:
parent
0971000e6e
commit
6e1a3af26d
1 changed files with 9 additions and 14 deletions
|
|
@ -1,21 +1,16 @@
|
|||
module.exports = api => {
|
||||
const isTest = api.env('test');
|
||||
|
||||
const preset = [
|
||||
"@babel/preset-env", { targets: 'defaults' }
|
||||
];
|
||||
const testPreset = [
|
||||
"@babel/preset-env", { targets: { node: process.versions.node } }
|
||||
];
|
||||
const preset = ['@babel/preset-env', { targets: 'defaults' }];
|
||||
const testPreset = ['@babel/preset-env', { targets: { node: process.versions.node } }];
|
||||
|
||||
const plugins = [
|
||||
"@babel/plugin-syntax-dynamic-import",
|
||||
"@babel/plugin-transform-react-jsx",
|
||||
"@babel/plugin-proposal-class-properties"
|
||||
]
|
||||
'@babel/plugin-transform-react-jsx',
|
||||
'@babel/plugin-proposal-class-properties',
|
||||
];
|
||||
|
||||
return {
|
||||
"presets": [isTest ? testPreset : preset],
|
||||
"plugins": plugins
|
||||
}
|
||||
}
|
||||
presets: [isTest ? testPreset : preset],
|
||||
plugins: plugins,
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue