generated from LaamGinghong/react-typescript-babel-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
33 lines (32 loc) · 960 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
const envPreset = [
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3,
modules: false,
},
]
module.exports = function (api) {
api.cache(true)
return {
presets: ['@babel/preset-typescript', envPreset],
plugins: [
'@babel/plugin-transform-runtime',
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
],
env: {
development: {
presets: [['@babel/preset-react', { development: true }]],
plugins: ['react-hot-loader/babel'],
},
production: {
presets: ['@babel/preset-react'],
plugins: [
'@babel/plugin-transform-react-constant-elements',
'@babel/plugin-transform-react-inline-elements',
],
},
},
}
}