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

65 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-02-04 14:09:35 +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',
2019-02-14 09:37:42 +00:00
'@babel/plugin-syntax-dynamic-import',
'dynamic-import-node',
2019-02-04 16:17:20 +00:00
[
'@babel/plugin-transform-runtime',
{
regenerator: true,
},
2019-02-04 14:09:35 +00:00
],
2019-02-04 16:17:20 +00:00
[
'module-resolver',
{
root: [
'./src',
2019-02-04 14:09:35 +00:00
],
2019-02-04 16:17:20 +00:00
alias: {
public: [
'./public',
],
},
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')) {
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
};
};