-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
34 lines (34 loc) · 872 Bytes
/
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
module.exports = (api) => {
const isTest = api.env("test");
const config = {
plugins: [],
presets: [
[
"@babel/env",
{
bugfixes: true,
useBuiltIns: "usage",
corejs: 3,
shippedProposals: true,
...(isTest
? {
targets: {
node: "current",
},
}
: {}),
},
],
],
};
if (isTest) {
config.presets.push([
"@babel/typescript",
{
allowDeclareFields: true,
onlyRemoveTypeImports: true,
},
]);
}
return config;
};