1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-30 12:18:09 +00:00

fix babel config

This commit is contained in:
slowbackspace 2019-02-04 17:17:20 +01:00
parent 6682647898
commit 0bb2573387

View File

@ -1,50 +1,51 @@
module.exports = (api) => {
api.cache(true);
// api.cache.forever();
const presets = [
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
loose: true,
},
],
'@babel/preset-react',
'@babel/preset-flow',
];
const plugins = [
'react-hot-loader/babel',
'@babel/plugin-transform-flow-strip-types',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
[
'@babel/plugin-transform-runtime',
{
regenerator: true,
},
],
[
'module-resolver',
{
root: [
'./src',
],
alias: {
public: [
'./public',
],
},
},
],
'babel-plugin-styled-components',
];
if (api.env('test')) {
presets.push('jest');
}
return {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
loose: true,
},
],
'@babel/preset-react',
'@babel/preset-flow',
],
plugins: [
'react-hot-loader/babel',
'@babel/plugin-transform-flow-strip-types',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
[
'@babel/plugin-transform-runtime',
{
regenerator: true,
},
],
[
'module-resolver',
{
root: [
'./src',
],
alias: {
public: [
'./public',
],
},
},
],
'babel-plugin-styled-components',
],
env: {
test: {
presets: [
'jest',
],
},
},
presets,
plugins,
};
};