forked from tangrams/tangram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
32 lines (31 loc) · 849 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
module.exports = 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,
loose: true,
debug: true,
useBuiltIns: ESM ? false : 'usage',
exclude: [
// we don't want these because we're using fast-async instead
'transform-async-to-generator',
'transform-regenerator',
'proposal-async-generator-functions'
]
}
],
],
plugins: [
ESM ? false : ['module:fast-async', {
spec: true // spec setting sticks to pure promises
}]
].filter(x => x)
};
};