-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
36 lines (36 loc) · 1016 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
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
[
'@babel/env',
{
useBuiltIns: 'usage',
corejs: {
version: 3,
proposals: true, // 使用尚在“提议”阶段特性的 polyfill
},
},
],
'@babel/preset-typescript',
],
env: {
development: {
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
// This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
// https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
plugins: [
'dynamic-import-node',
// 以下插件具有先后顺序
// 首先编译装饰器语法
[
'@babel/plugin-proposal-decorators',
{
legacy: true,
},
],
// 再编译 class 语法
'@babel/plugin-proposal-class-properties',
],
},
},
}