element-plus/babel.config.js

55 lines
1.2 KiB
JavaScript
Raw Normal View History

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',
'@babel/plugin-proposal-nullish-coalescing-operator',
['@babel/plugin-proposal-private-methods', { loose: true }],
'@babel/transform-runtime',
'lodash',
],
overrides: [
{
test: /\.vue$/,
plugins: ['@babel/transform-typescript'],
},
],
env: {
utils: {
ignore: ['**/*.test.ts', '**/*.spec.ts'],
presets: [
[
'@babel/env',
{
loose: true,
2020-11-28 18:56:14 +08:00
modules: false,
},
],
],
plugins: [
[
'babel-plugin-module-resolver',
{
root: ['element-plus'],
alias: {
'@element-plus': 'element-plus/lib',
},
},
],
],
},
},
}