Babel 7 转码(七)- 装饰器语法、动态导入
装饰器语法支持
安装依赖
yarn add @babel/plugin-proposal-decorators @babel/plugin-proposal-class-properties -D
.babelrc 增加配置
{ "presets": [], "plugins": [ [ "@babel/plugin-proposal-decorators", // @babel/plugin-proposal-decorators需要在@babel/plugin-proposal-class-properties之前 { "legacy": true // 推荐 } ], [ "@babel/plugin-proposal-class-properties", { "loose": true // babel编译时,对class的属性采用赋值表达式,而不是Object.defineProperty(更简洁) } ] ] }
import - 动态导入支持
安装依赖
yarn add @babel/plugin-syntax-dynamic-import -D
.babelrc 文件增加配置
{ "presets": [], "plugins": [ "@babel/plugin-syntax-dynamic-import", ] }
相关推荐
PANH 2020-01-23
PANH 2019-10-28
Fairfeng 2019-09-08
lbn0 2019-09-08
82530995 2020-10-15
ruanhongbiao 2020-08-16
FEvivi 2020-06-16
FEvivi 2020-06-13
PANH 2020-06-12
zhongweinan 2020-06-10
PANH 2020-06-07
PANH 2020-06-01
82530995 2020-05-10
webfullStack 2020-04-26
zhongweinan 2020-04-24
FEvivi 2020-04-17
FEvivi 2020-04-15
zhongweinan 2020-03-03
zhongweinan 2020-02-21