npx webpack serve
时,我会收到这个错误:[webpack-cli] Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'contentBase'. These properties are valid:
object { bonjour?, client?, compress?, devMiddleware?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, public?, setupExitSignals?, static?, transportMode?, watchFiles? }
这是我的webpack.config.js文件,适用于3.11.2版本:
这是我的webpack.config.js文件,适用于3.11.2版本:
const path = require('path');
const ArcGISPlugin = require("@arcgis/webpack-plugin");
module.exports = {
mode: 'development',
entry: {
main: './app/main.js'
},
plugins: [
new ArcGISPlugin()
],
devServer: {
contentBase: './'
}
}
我在package.json中的devDependencies:
"devDependencies": {
"@arcgis/webpack-plugin": "^4.18.0",
"dojo-typings": "^1.11.11",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^4.0.0-beta.3"
如何更新我的配置文件以使最新版本工作?当我删除 dev server 对象时,服务器将运行,但提供的内容位于./public 目录下,而该目录不存在。
我是 webpack 新手,所以我还不太熟悉应用程序、配置和要求。