forked from zouhir/jarvis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.js
31 lines (30 loc) · 769 Bytes
/
babel.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
const babelrc = (env = null) => {
const isProd = env === 'production'
return {
babelrc: false,
presets: [
[
'babel-preset-env',
{
loose: true,
uglify: true,
modules: false,
targets: {
browsers: ['> 1%', 'last 2 versions', 'IE >= 9']
},
exclude: ['transform-regenerator', 'transform-es2015-typeof-symbol']
}
],
'stage-0'
],
plugins: [
'babel-plugin-transform-object-assign',
'babel-plugin-transform-decorators-legacy',
isProd
? 'babel-plugin-transform-react-remove-prop-types'
: null,
['babel-plugin-transform-react-jsx', { pragma: 'h' }]
].filter(Boolean)
};
};
module.exports = babelrc;