babel编译es7

报错

Decorators are not supported yet in 6.x pending proposal update.

安装

npm i --save-dev babel-plugin-transform-decorators-legacy
npm install --save-dev babel-preset-stage-0

gulp或者webpack中加:

plugins:['transform-decorators-legacy'],
presets: ['es2015','stage-0']

参考

Comments
Write a Comment