-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbabel.config.js
More file actions
54 lines (53 loc) · 1.69 KB
/
babel.config.js
File metadata and controls
54 lines (53 loc) · 1.69 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
module.exports = function(api) {
api.cache(true);
return {
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "entry",
corejs: 3,
debug: false,
targets: {
edge: "17",
firefox: "60",
chrome: "67",
safari: "11.1",
ie: "11"
}
}
],
"@babel/preset-react"
],
// Include modules that need to be transpiled here
ignore: [
filename => {
const modulesToTranspile = [];
if (!/\/node_modules\//.test(filename)) {
return false; // if not in node_modules, we want to compile it
} else {
for (let module of modulesToTranspile) {
const regex = new RegExp(`node_modules/${module}`);
if (regex.test(filename)) {
console.log(
`=^._.^= ∫ Module not excluded from transpilation: ${filename}`
);
return false;
}
}
}
// it's in node modules and NOT our source code
return true;
}
],
plugins: [
"@babel/plugin-proposal-object-rest-spread",
[
"@babel/plugin-proposal-class-properties",
{
loose: true
}
]
]
};
};