-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
64 lines (63 loc) · 1.43 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const runtimeVersion = require("@babel/runtime/package.json").version;
const corejsVersion = require('core-js/package.json').version;
module.exports = ({ env }) => ({
assumptions: {
constantReexports: true,
constantSuper: true,
enumerableModuleMeta: true,
ignoreFunctionLength: true,
ignoreToPrimitiveHint: true,
iterableIsArray: true,
mutableTemplateObject: true,
noClassCalls: true,
noDocumentAll: true,
noNewArrows: true,
objectRestNoSymbols: true,
privateFieldsAsProperties: true,
pureGetters: true,
setClassMethods: true,
setComputedProperties: true,
setPublicClassFields: true,
setSpreadProperties: true,
skipForOfIteratorClosing: true,
superIsCallableConstructor: true,
},
presets: [
[
"@babel/preset-env",
{
targets: {
chrome: "70",
ie: "11",
},
modules: env("test") ? "commonjs" : false,
useBuiltIns: "usage",
corejs: corejsVersion,
bugfixes: true,
},
],
[
"@babel/preset-react",
{
runtime: "automatic",
},
],
[
"@babel/preset-typescript",
{
isTSX: true,
allExtensions: true,
},
],
],
plugins: [
env("development") && "react-refresh/babel",
[
"@babel/plugin-transform-runtime",
{
regenerator: false,
version: runtimeVersion,
},
],
].filter(Boolean),
});