forked from Opentrons/opentrons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
48 lines (45 loc) · 1.16 KB
/
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
44
45
46
47
48
'use strict'
const PRESET_ENV_NO_MODULES = [
'@babel/preset-env',
{
modules: false,
// TODO(mc, 2019-03-13): uncomment this line to enable babel polyfill
// useBuiltIns: 'usage',
},
]
const PRESET_ENV_CJS_MODULES = ['@babel/preset-env', { modules: 'commonjs' }]
module.exports = {
env: {
production: {
// TODO(mc, 2019-03-13): add '@babel/plugin-transform-runtime'
// along with useBuiltIns TODO above
plugins: ['babel-plugin-unassert'],
},
development: {
plugins: ['react-hot-loader/babel'],
},
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
'babel-plugin-dynamic-import-node',
],
},
},
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-syntax-dynamic-import',
],
presets: ['@babel/preset-flow', '@babel/preset-react', PRESET_ENV_NO_MODULES],
overrides: [
{
test: 'app-shell/**/*',
presets: [PRESET_ENV_CJS_MODULES],
},
{
test: 'discovery-client/**/*',
presets: [PRESET_ENV_CJS_MODULES],
},
],
}