forked from react-dropzone/react-dropzone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.babelrc.js
28 lines (26 loc) · 819 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
// https://babeljs.io/docs/en/configuration
const presets = ['@babel/preset-react']
if (process.env['BABEL_ENV'] === 'es') {
presets.unshift(['@babel/preset-env', { modules: false }])
} else {
presets.unshift('@babel/preset-env')
}
const plugins = [
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-logical-assignment-operators',
['@babel/plugin-proposal-optional-chaining', { loose: false }],
['@babel/plugin-proposal-pipeline-operator', { proposal: 'minimal' }],
['@babel/plugin-proposal-nullish-coalescing-operator', { loose: false }],
'@babel/plugin-proposal-do-expressions',
'add-module-exports'
]
module.exports = {
presets,
plugins,
env: {
test: {
presets,
plugins: [...plugins, '@babel/plugin-transform-runtime', 'dynamic-import-node']
}
}
}