-
Notifications
You must be signed in to change notification settings - Fork 1
/
babel.config.js
43 lines (41 loc) · 956 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 plugins = ['@babel/plugin-transform-runtime', '@babel/plugin-syntax-dynamic-import'];
const presets = [
[
'@babel/preset-env',
{
modules: false,
useBuiltIns: 'entry',
corejs: '3',
targets: {
browsers: ['last 2 versions'],
},
},
],
'@babel/preset-typescript',
'@babel/preset-react',
];
const emotionPresetOpts = {
autoLabel: true,
labelFormat: '[local]',
useBuiltIns: false,
throwIfNamespace: true,
};
module.exports = {
env: {
production: {
presets: [
...presets,
// babel preset ordering is reversed: https://babeljs.io/docs/en/presets#preset-ordering
['@emotion/babel-preset-css-prop', { ...emotionPresetOpts, sourceMap: false }],
],
plugins,
},
development: {
presets: [
...presets,
['@emotion/babel-preset-css-prop', { ...emotionPresetOpts, sourceMap: true }],
],
plugins,
},
},
};