-
Notifications
You must be signed in to change notification settings - Fork 1
/
.babelrc.js
37 lines (37 loc) · 1.33 KB
/
.babelrc.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
35
36
37
module.exports = {
presets: [
// Specify multiple plugins by using presets
[
'@babel/preset-env', // Transpile latest JS features
{
corejs: 2,
useBuiltIns: 'usage', // Automatic polyfill import - only when features that needs to be polyfilled are used in the code
},
],
'@babel/preset-react', // Add support for jsx
],
plugins: [
// Specify single plugins
'react-hot-loader/babel', // Add support for hot module replacement
'@babel/plugin-proposal-class-properties', // Transform static class properties
'@babel/plugin-syntax-dynamic-import', // Add support for dynamic imports
],
env: {
// Specific environment settings
production: {
plugins: [
[
'transform-react-remove-prop-types', // Remove proptypes from production
{
mode: 'remove',
removeImport: true,
ignoreFilenames: ['node_modules'],
},
],
],
},
test: {
plugins: ['dynamic-import-node'], // Plugins that need to be added for tests in order to transpile correctly
},
},
}