forked from babel/babel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.babelrc.js
42 lines (37 loc) · 996 Bytes
/
.babelrc.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
"use strict";
let envOpts = {
loose: true,
};
const config = {
comments: false,
presets: [["@babel/env", envOpts]],
plugins: [
// TODO: Use @babel/preset-flow when
// https://github.com/babel/babel/issues/7233 is fixed
"@babel/plugin-transform-flow-strip-types",
["@babel/proposal-class-properties", { loose: true }],
"@babel/proposal-export-namespace-from",
"@babel/proposal-numeric-separator",
["@babel/proposal-object-rest-spread", { useBuiltIns: true }],
],
overrides: [
{
test: "packages/babylon",
plugins: [
"babel-plugin-transform-charcodes",
["@babel/transform-for-of", { assumeArray: true }],
],
},
],
};
if (process.env.BABEL_ENV === "cov") {
config.auxiliaryCommentBefore = "istanbul ignore next";
config.plugins.push("babel-plugin-istanbul");
}
if (process.env.BABEL_ENV === "development") {
envOpts.targets = {
node: "current",
};
envOpts.debug = true;
}
module.exports = config;