Javascript 在babel6中使用transform decorators legacy
我以前收到过这个错误消息Javascript 在babel6中使用transform decorators legacy,javascript,vue.js,babeljs,Javascript,Vue.js,Babeljs,我以前收到过这个错误消息 Syntax Error: Decorators are not officially supported yet in 6.x pending a proposal update. However, if you need to use them you can install the legacy decorators transform with: npm install babel-plugin-transform-decorators-legacy --sa
Syntax Error: Decorators are not officially supported yet in 6.x pending a proposal update.
However, if you need to use them you can install the legacy decorators transform with:
npm install babel-plugin-transform-decorators-legacy --save-dev
and add the following line to your .babelrc file:
{
"plugins": ["transform-decorators-legacy"]
}
The repo url is: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy.
所以,我在package.json文件中将babel插件转换装饰器添加到devDepencies
并将插件添加到.babelrc文件并安装模块。
但是我收到了这个错误信息
Module build failed: ReferenceError: Unknown plugin "transform-decorators-legacy" specified in [Project Path]