forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.babelrc.js
30 lines (29 loc) · 854 Bytes
/
.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
const commonjs = process.env.BABEL_ENV !== 'esm';
module.exports = {
presets: [
[
'@babel/preset-env',
{
loose: true,
shippedProposals: true,
modules: commonjs ? 'commonjs' : false,
targets: {
browsers: ['last 4 versions', 'not ie <= 8']
}
}
],
[
'@babel/preset-react',
{ development: process.env.NODE_ENV !== 'production' }
]
],
plugins: [
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-export-namespace-from',
['@babel/plugin-transform-runtime', { useESModules: !commonjs }],
'babel-plugin-dev-expression',
commonjs && 'babel-plugin-add-module-exports',
process.env.NODE_ENV === 'test' && 'babel-plugin-istanbul'
].filter(Boolean)
};