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 => {
|
module.exports = api => {
|
||||||
const isTest = api.env('test');
|
const isTest = api.env('test');
|
||||||
|
|
||||||
const preset = [
|
const preset = ['@babel/preset-env', { targets: 'defaults' }];
|
||||||
"@babel/preset-env", { targets: 'defaults' }
|
const testPreset = ['@babel/preset-env', { targets: { node: process.versions.node } }];
|
||||||
];
|
|
||||||
const testPreset = [
|
|
||||||
"@babel/preset-env", { targets: { node: process.versions.node } }
|
|
||||||
];
|
|
||||||
|
|
||||||
const plugins = [
|
const plugins = [
|
||||||
"@babel/plugin-syntax-dynamic-import",
|
'@babel/plugin-transform-react-jsx',
|
||||||
"@babel/plugin-transform-react-jsx",
|
'@babel/plugin-proposal-class-properties',
|
||||||
"@babel/plugin-proposal-class-properties"
|
];
|
||||||
]
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"presets": [isTest ? testPreset : preset],
|
presets: [isTest ? testPreset : preset],
|
||||||
"plugins": plugins
|
plugins: plugins,
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue