当我将webpack升级到4.0.0-beta.3并运行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? }这是我在3.11.2中工作的webpack.config.js:
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服务器对象时,服务器将运行,但提供的内容来自./public,而./public并不存在。
我是新手,所以对应用程序、配置和需求还不熟悉。
发布于 2021-06-11 02:29:25
devServer: {
static: './'
}我应该更仔细地阅读错误。上面的对象使我的配置再次工作。
https://stackoverflow.com/questions/67926476
复制相似问题