-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbabel.config.js
More file actions
56 lines (55 loc) · 1.24 KB
/
babel.config.js
File metadata and controls
56 lines (55 loc) · 1.24 KB
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
49
50
51
52
53
54
55
56
module.exports = {
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "usage",
corejs: 3,
modules: false,
exclude: ["transform-typeof-symbol"],
},
],
["@babel/preset-react"],
["@babel/preset-typescript"],
],
plugins: [
[
"import",
{
libraryName: "antd",
style: "css",
},
"antd",
],
["@babel/plugin-proposal-decorators", { legacy: true }],
[
"@babel/plugin-proposal-class-properties",
{
loose: true,
},
],
[
"@babel/plugin-proposal-object-rest-spread",
{
useBuiltIns: true,
},
],
[
"@babel/plugin-transform-runtime",
{
corejs: false,
helpers: true,
regenerator: false, // 通过 preset-env 已经使用了全局的 regeneratorRuntime, 不再需要 transform-runtime 提供的 不污染全局的 regeneratorRuntime
useESModules: true, // 使用 es modules helpers, 减少 commonJS 语法代码
},
],
["@babel/plugin-syntax-dynamic-import"],
/*[
require("./scripts/polyfillsPlugin"),
{
polyfills: ["es.promise"],
entryFiles: JSON.parse(process.env.ENTRY_FILES),
},
],*/
],
};