forked from ivarprudnikov/rjsf-conditionals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
43 lines (41 loc) · 961 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
34
35
36
37
38
39
40
41
42
43
const BABEL_ENV = process.env.BABEL_ENV || process.env.NODE_ENV;
const defaultPlugins = [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
// IE 11 support
'@babel/plugin-transform-object-assign'
];
module.exports = {
presets: [
[
'@babel/preset-env',
{
modules: ['cjs', 'test'].includes(BABEL_ENV) ? 'commonjs' : false,
targets:
BABEL_ENV === 'test' ? { node: 'current' } : { browsers: 'defaults' }
}
],
'@babel/preset-react'
],
env: {
cjs: {
plugins: defaultPlugins,
ignore: ['test/**/*.js']
},
umd: {
plugins: defaultPlugins,
ignore: ['test/**/*.js']
},
es: {
plugins: [
...defaultPlugins,
['@babel/plugin-transform-runtime', { useESModules: true, corejs: 2 }]
],
ignore: ['test/**/*.js']
},
test: {
plugins: defaultPlugins,
ignore: []
}
}
};