我正在创建一个同构的React应用程序,当前正在创建一个堆栈。
当我想测试this[pin.dataset.method](event)
是否一切正常时,我收到以下错误:
npm run build
webpack config pr包json文件中可能存在一些错误,但我不知道到底是什么
我的package.json文件中有一个“调试”属性:
package.json
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration has an unknown property 'debug'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions? }
The 'debug' property was removed in webpack 2.0.0.
Loaders should be updated to allow passing this option via loader options in module.rules.
Until loaders are updated one can use the LoaderOptionsPlugin to switch loaders into debug mode:
plugins: [
new webpack.LoaderOptionsPlugin({
debug: true
})
]
- configuration.resolve.extensions[0] should not be empty.
-> A non-empty string
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-isomorphic-app@1.0.0 build: `set NODE_ENV='production' && webpack -p`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-isomorphic-app@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Empeek\AppData\Roaming\npm-cache\_logs\2019-01-17T15_35_03_122Z-debug.log
webpack.config.js
{
"name": "react-isomorphic-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "set NODE_ENV='production' && webpack -p",
"webpack-devserver": "webpack-dev-server --debug --hot --devtool eval-source-map --output-pathinfo --watch --colors --inline --content-base public --port 8050 --host 0.0.0.0"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-core": "^6.26.3",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"bluebird": "^3.5.3"
},
"devDependencies": {
"babel-loader": "^8.0.5",
"clean-webpack-plugin": "^1.0.0",
"css-loader": "^2.1.0",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^3.0.1",
"html-loader": "^0.5.5",
"json-loader": "^0.5.7",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"postcss-loader": "^3.0.0",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"webpack": "^4.28.4",
"webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.1.14"
}
}
您能帮我解决此错误吗?