用webpack打包的时候,出现了报错,情况如下:
image.png
package.json文件是这样配置命令的:
"scripts": {
"start": "npm-run-all --parallel dev:*",
"dev:server-compile": "webpack --config webpack.config.server.js --watch",
"dev:server": "nodemon ./build/server.js",
"dev:client-compile": "webpack --config webpack.config.client.js --watch"
}
可能是因为我的webpack,webpack-cli,webpack-dev-server版本不匹配导致的。
我用的版本:
"webpack": "^5.10.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.2",
建议的版本:
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
网友评论