-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path.babelrc.js
More file actions
28 lines (27 loc) · 770 Bytes
/
.babelrc.js
File metadata and controls
28 lines (27 loc) · 770 Bytes
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
'use strict';
const output = process.env.BABEL_OUTPUT;
const requirePolyfills = process.env.INCLUDE_POLYFILLS;
const modules = output == null ? false : output;
const options = {
presets: [['@babel/env', {loose: true, modules}], '@babel/react'],
plugins: [
'@babel/plugin-transform-react-jsx',
[
'transform-react-remove-prop-types',
{
mode: 'remove',
ignoreFilenames: ['node_modules'],
},
],
],
env: {
test: {
// extra configuration for process.env.NODE_ENV === 'test'
presets: ['@babel/env'], // overwrite env-config from above with transpiled module syntax
},
},
};
if (requirePolyfills) {
options.plugins.push(['@babel/plugin-transform-runtime', {corejs: 3}]);
}
module.exports = options;