2020-11-10 14:24:09 +08:00
|
|
|
module.exports = {
|
|
|
|
// ATTENTION!!
|
|
|
|
// Preset ordering is reversed, so `@babel/typescript` will called first
|
|
|
|
// Do not put `@babel/typescript` before `@babel/env`, otherwise will cause a compile error
|
|
|
|
// See https://github.com/babel/babel/issues/12066
|
|
|
|
presets: [
|
|
|
|
[
|
|
|
|
'@babel/env',
|
|
|
|
{
|
|
|
|
loose: true,
|
|
|
|
modules: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'@babel/typescript',
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
'@vue/babel-plugin-jsx',
|
2021-09-05 19:57:35 +08:00
|
|
|
'@babel/plugin-proposal-nullish-coalescing-operator',
|
|
|
|
['@babel/plugin-proposal-private-methods', { loose: true }],
|
2020-11-10 14:24:09 +08:00
|
|
|
'@babel/transform-runtime',
|
|
|
|
'lodash',
|
|
|
|
],
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
2021-09-04 19:29:28 +08:00
|
|
|
plugins: ['@babel/transform-typescript'],
|
2020-11-10 14:24:09 +08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
env: {
|
|
|
|
utils: {
|
2021-09-04 19:29:28 +08:00
|
|
|
ignore: ['**/*.test.ts', '**/*.spec.ts'],
|
2020-11-10 14:24:09 +08:00
|
|
|
presets: [
|
|
|
|
[
|
|
|
|
'@babel/env',
|
|
|
|
{
|
|
|
|
loose: true,
|
2020-11-28 18:56:14 +08:00
|
|
|
modules: false,
|
2020-11-10 14:24:09 +08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
[
|
|
|
|
'babel-plugin-module-resolver',
|
|
|
|
{
|
|
|
|
root: ['element-plus'],
|
|
|
|
alias: {
|
|
|
|
'@element-plus': 'element-plus/lib',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|