-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.cjs
34 lines (30 loc) · 1.02 KB
/
babel.config.cjs
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
const env = process.env.BABEL_ENV || 'esm';
module.exports = {
targets: {
node: '14.15', // Support Node v14.15 (Fermium) LTS or higher
browsers: [
'defaults',
],
},
presets: [
['@babel/env', {
// Whether to transpile modules
modules: env === 'cjs' ? 'commonjs' : false,
// Do not include polyfills automatically. Leave it up to the consumer to include the right polyfills
// for their required environment.
useBuiltIns: false,
exclude: [
// Do not transpile generators (saves us from needing a polyfill)
'transform-regenerator',
],
}],
'@babel/typescript',
],
plugins: [
['transform-builtin-extend', {
// See: http://stackoverflow.com/questions/33870684/why-doesnt-instanceof-work
globals: ['Error', 'String', 'Number', 'Array', 'Promise'],
}],
],
sourceMaps: 'inline',
};