forked from Automattic/wp-calypso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
33 lines (30 loc) · 873 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
const isBrowser = process.env.BROWSERSLIST_ENV !== 'server';
// We implicitly use browserslist configuration in package.json for build targets.
const babelConfig = {
presets: [ [ '@automattic/calypso-build/babel/default', { bugfixes: true } ] ],
plugins: [ [ '@automattic/transform-wpcalypso-async', { async: true, ignore: ! isBrowser } ] ],
env: {
production: {
plugins: [ 'babel-plugin-transform-react-remove-prop-types' ],
},
build_pot: {
plugins: [
[
'@automattic/babel-plugin-i18n-calypso',
{
dir: 'build/i18n-calypso/',
headers: {
'content-type': 'text/plain; charset=UTF-8',
'x-generator': 'calypso',
},
},
],
],
},
test: {
presets: [ [ '@babel/env', { targets: { node: 'current' } } ] ],
plugins: [ 'babel-plugin-dynamic-import-node' ],
},
},
};
module.exports = babelConfig;