-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
40 lines (38 loc) · 1.12 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
const envUtils = require('./starter/utils/env');
const isModern = envUtils.checkModern();
// const isProd = envUtils.checkProd();
// const isServer = envUtils.checkServer();
module.exports = {
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "usage",
corejs: { version: 3, proposals: true },
shippedProposals: true,
targets: isModern ? { esmodules: true } : {},
exclude: [
/esnext.map/,
/esnext.set/,
],
// debug: !isProd && !isServer,
}
],
[
"@babel/preset-react",
{
runtime: "classic",
}
],
"@babel/preset-typescript",
"@emotion/babel-preset-css-prop"
],
plugins: [
// "@babel/plugin-transform-runtime", // https://github.com/babel/babel/issues/6629#issuecomment-416986687
// "@babel/plugin-proposal-class-properties", // https://babeljs.io/docs/en/babel-preset-env#shippedproposals
// "@babel/plugin-proposal-object-rest-spread",
// "@babel/plugin-proposal-optional-chaining",
// "@babel/plugin-proposal-nullish-coalescing-operator",
"@loadable/babel-plugin"
]
};