-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
53 lines (50 loc) · 1.16 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const { browserslist: defaultBrowserslist } = require('./package.json');
const modernBrowserslist = defaultBrowserslist.filter(
(browser) => browser !== 'ie 11'
);
const sharedPlugins = [
'@babel/plugin-syntax-dynamic-import',
[
'@babel/plugin-transform-runtime',
{
useESModules: true
}
]
];
module.exports = {
exclude: [
'node_modules/@babel/**',
'node_modules/core-js/**',
'node_modules/@webcomponents/webcomponentsjs/**'
],
env: {
modern: {
// lit-element supports the last two versions of modern browsers, so we don't need to polyfill
exclude: ['node_modules/lit-element/**', 'node_modules/lit-html/**'],
presets: [
[
'@babel/preset-env',
{
targets: modernBrowserslist.join(', '),
useBuiltIns: 'usage',
corejs: 3
}
]
],
plugins: sharedPlugins
},
legacy: {
presets: [
[
'@babel/preset-env',
{
targets: defaultBrowserslist.join(', '),
useBuiltIns: 'usage',
corejs: 3
}
]
],
plugins: sharedPlugins
}
}
};