-
Notifications
You must be signed in to change notification settings - Fork 18
/
babel.config.js
52 lines (48 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
var plugins = [
"@babel/plugin-transform-typescript",
"@babel/plugin-transform-runtime",
];
const presetEnvOptions = {
// Use .browserslist by not specifying targets and ignoreBrowserslistConfig
// During testing, however, we want specify targets so that no polyfill is required.
// Enable optimization https://babeljs.io/docs/en/babel-preset-env#bugfixes
bugfixes: true,
// Keep module syntax untouched.
// During build, rollup handles module for us.
// During testing, we use plugin-transform-modules-commonjs.
modules: false,
debug: false,
useBuiltIns: false,
};
if (process.env.NODE_ENV === "test") {
plugins.push("@babel/plugin-transform-modules-commonjs");
presetEnvOptions.targets = {
node: "12",
};
}
module.exports = {
assumptions: {
arrayLikeIsIterable: false,
constantReexports: true,
constantSuper: true,
enumerableModuleMeta: true,
ignoreFunctionLength: true,
ignoreToPrimitiveHint: false,
iterableIsArray: true,
mutableTemplateObject: true,
noClassCalls: true,
noDocumentAll: true,
noIncompleteNsImportDetection: false,
noNewArrows: true,
objectRestNoSymbols: true,
pureGetters: true,
setClassMethods: true,
setComputedProperties: true,
setPublicClassFields: true,
setSpreadProperties: true,
skipForOfIteratorClosing: false,
superIsCallableConstructor: false,
},
plugins,
presets: [["@babel/preset-env", presetEnvOptions]],
};