Bable配置decorator报错
配置:
"babel-core": "^6.17.0",
{
"plugins": [
"transform-class-properties",
"transform-es2015-block-scoping",
["transform-es2015-classes", {"loose": true}],
"transform-proto-to-assign",
"transform-decorators-legacy",
"transform-es2015-modules-commonjs"
],
"presets": [
"react",
"es2015",
"stage-0"
]
}
报错:
Method has decorators, put the decorator plugin before the classes one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
参考:babel-plugin-transform-decorators-legacy
NOTE: Order of Plugins Matters!
If you are including your plugins manually and using transform-class-properties, make sure that transform-decorators-legacy comes before transform-class-properties.
挖出一篇老问题,legacy 的位置很重要