forked from taye/interact.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
36 lines (34 loc) · 1002 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
35
36
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 },
],
].filter(Boolean),
plugins: [
require.resolve('./scripts/babel/vue-sfc'),
require.resolve('@babel/plugin-proposal-class-properties'),
[
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 },
],
[
require.resolve('@babel/plugin-transform-modules-commonjs'),
{ noInterop: isProd },
],
].filter(Boolean),
}