-
Notifications
You must be signed in to change notification settings - Fork 4
/
babel.config.js
34 lines (29 loc) · 867 Bytes
/
babel.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { ignoreCommonGlobs, es5Browsers } = require('./babel.utils');
const ignoreGlobsForTest = [
'dist',
];
// This config is used by standalone app.
module.exports = api => {
const isTest = api.env('test');
return {
extends: './babel.config.base',
ignore: isTest ? ignoreGlobsForTest : ignoreCommonGlobs,
plugins: [
// This plugin transforms ECMAScript modules to CommonJS
// some scripts in "./bin" folder need this.
'@babel/plugin-transform-modules-commonjs',
['react-intl', { messagesDir: './build-output/messages' }],
'@babel/plugin-proposal-class-properties'
],
presets: [
[
'@babel/preset-env',
isTest
? undefined
: { bugfixes: true, modules: false, targets: es5Browsers },
],
'@babel/react',
'@babel/preset-typescript',
]
};
};