-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
28 lines (23 loc) · 943 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
const isDev = !process.env.NODE_ENV || process.env.NODE_ENV === 'development';
console.log('using babel.config.js');
module.exports = function (api) {
api.cache(false);
let presets = [
[
'@babel/preset-env',
{
corejs: 3, // To polyfill ES6 features for browsers that don't support them
useBuiltIns: 'usage', // With this, @babel/preset-env replaces direct imports of core-js to imports of only the specific modules required for a target environment: https://karen-kua.medium.com/the-end-of-babel-polyfill-the-more-efficient-alternative-95f959fef9c2
targets: 'defaults, not ie <= 11', // https://github.com/browserslist/browserslist#full-list
// debug: true,
},
],
// '@babel/preset-typescript',
];
let plugins = [];
return {
presets,
plugins,
comments: isDev,
};
};