You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
660 B
40 lines
660 B
const { NODE_ENV } = process.env
|
|
|
|
const presets = [
|
|
[
|
|
'@babel/preset-env',
|
|
{
|
|
loose: true,
|
|
modules: NODE_ENV === 'test' ? 'commonjs' : false,
|
|
targets: {
|
|
electron: '1.8',
|
|
node: 'current',
|
|
},
|
|
},
|
|
],
|
|
'@babel/preset-flow',
|
|
'@babel/preset-react',
|
|
'@babel/preset-stage-0',
|
|
]
|
|
|
|
const plugins = [
|
|
['babel-plugin-module-resolver', { root: ['src'] }],
|
|
[
|
|
'babel-plugin-styled-components',
|
|
{
|
|
displayName: NODE_ENV === 'development',
|
|
minify: NODE_ENV === 'production',
|
|
},
|
|
],
|
|
]
|
|
|
|
module.exports = {
|
|
presets,
|
|
plugins,
|
|
env: {
|
|
test: {
|
|
presets,
|
|
plugins,
|
|
},
|
|
},
|
|
}
|
|
|