-
Notifications
You must be signed in to change notification settings - Fork 290
Expand file tree
/
Copy pathbabel.config.js
More file actions
31 lines (30 loc) · 862 Bytes
/
Copy pathbabel.config.js
File metadata and controls
31 lines (30 loc) · 862 Bytes
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
export default function(context) {
const ESM = (process.env.ESM !== 'false'); // default to ESM on
const cache = context.cache(() => ESM);
const targets = ESM ?
{ esmodules: true } :
{ browsers: ['ie >= 11'] };
return {
presets: [
[
'@babel/preset-env', {
targets,
bugfixes: true,
// debug: true, // uncomment for debugging build issues
exclude: [
// we don't want these because we're using fast-async instead
'transform-async-to-generator',
'transform-regenerator',
'proposal-async-generator-functions'
]
}
],
],
plugins: [
'@babel/plugin-transform-runtime',
ESM ? false : ['module:fast-async', {
spec: true // spec setting sticks to pure promises
},]
].filter(x => x)
};
}