关于报错Support for the experimental syntax 'decorators-legacy' isn't currently enabled
报错原因装饰器写法不被支持解决办法bable转码npm install @babel/plugin-proposal-decorators配置package.json“babel”: {“plugins”: [[“@babel/plugin-proposal-decorators”,{“legacy”: true}]],“presets”: [“react-app”...
·
报错原因
装饰器写法不被支持
解决办法
bable转码
npm install @babel/plugin-proposal-decorators
配置package.json
"babel": {
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
],
"presets": [
"react-app"
]
},
发现直接写在package.json中不管用,
需要先git add .
接着git commit -m 'init'
最后npm run eject
之后再把
"babel": {
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
],
"presets": [
"react-app"
]
},
写在package.json中
更多推荐


所有评论(0)