我正在组装一个小型React App,并尝试将MobX纳入依赖项。下面是babel的package.json设置。
"babel": {
"presets": [
"@babel/preset-env",
"react-app"
],
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
]
]
},
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.1.2",
"babel-plugin-transform-decorators-legacy": "^1.3.5"
}
启动服务器时出现的实际错误如下:
./src/index.js
Module build failed: ReferenceError: Unknown plugin "@babel/plugin-proposal-
decorators" specified in
"/Users/briankaty1/Desktop/mobx/aquastars/react_aquastars/package.json" at 0,
attempted to resolve relative to
"/Users/briankaty1/Desktop/mobx/aquastars/react_aquastars"
任何帮助将不胜感激。