forked from taye/interact.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
27 lines (25 loc) · 1011 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
const isProd = process.env.NODE_ENV === 'production'
module.exports = {
presets: [
[require.resolve('@babel/preset-env'), { exclude: ['transform-regenerator'] }],
[
require.resolve('@babel/preset-typescript'),
{ isTsx: false, onlyRemoveTypeImports: true, allExtensions: true, allowDeclareFields: true },
],
].filter(Boolean),
plugins: [
require.resolve('./scripts/babel/vue-sfc'),
[
require.resolve('@babel/plugin-transform-runtime'),
{
helpers: false,
regenerator: false,
},
],
isProd && require.resolve('./scripts/babel/for-of-array'),
isProd && require.resolve('@babel/plugin-proposal-optional-catch-binding'),
isProd && [require.resolve('@babel/plugin-proposal-optional-chaining'), { loose: true }],
isProd && [require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), { loose: true }],
[require.resolve('@babel/plugin-transform-modules-commonjs'), { noInterop: isProd }],
].filter(Boolean),
}