1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-27 10:48:22 +00:00
trezor-wallet/babel.config.js

58 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-04-02 15:41:28 +00:00
module.exports = api => {
2019-02-04 16:17:20 +00:00
// api.cache.forever();
2019-02-04 14:09:35 +00:00
2019-02-04 16:17:20 +00:00
const presets = [
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
loose: true,
},
2019-02-04 14:09:35 +00:00
],
2019-02-04 16:17:20 +00:00
'@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,
},
2019-02-04 14:09:35 +00:00
],
2019-02-04 16:17:20 +00:00
[
'module-resolver',
{
2019-04-02 15:41:28 +00:00
root: ['./src'],
2019-02-04 16:17:20 +00:00
alias: {
2019-04-02 15:41:28 +00:00
public: ['./public'],
2019-02-04 16:17:20 +00:00
},
2019-02-04 14:09:35 +00:00
},
2019-02-04 16:17:20 +00:00
],
'babel-plugin-styled-components',
];
if (api.env('test')) {
presets.push('jest');
}
if (api.env('translations')) {
2019-04-02 15:41:28 +00:00
plugins.push([
'react-intl',
{
messagesDir: './translations/extractedMessages/',
extractSourceLocation: true,
},
]);
}
2019-02-04 16:17:20 +00:00
return {
presets,
plugins,
2019-02-04 14:09:35 +00:00
};
2019-04-02 15:41:28 +00:00
};