-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbabel.config.js
34 lines (33 loc) · 994 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')
return {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage', // Load the same polyfill only once
corejs: 3,
bugfixes: true, // Compile the broken syntax to the closest non-broken modern syntax
shippedProposals: true, // No transformation of feature proposals, if target env have native support
loose: true,
modules: isTest && 'commonjs',
ignoreBrowserslistConfig: true,
targets: isTest ? { node: 'current' } : `node ${require('./package.json').engines.node}`,
},
],
],
plugins: [
[
'@babel/plugin-transform-runtime',
{
absoluteRuntime: false,
corejs: false,
helpers: true,
regenerator: false,
useESModules: !isTest,
version: require('@babel/runtime-corejs3/package.json').version,
},
],
],
}
}