admin 发表于 2022-1-26 12:39:33

[webpack-cli] Invalid options object. Dev Server has been initialized using a...

问题内容:

Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options has an unknown property 'contentBase'. These properties are valid:
   object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, static?, watchFiles?, webSocketServer? }


问题解决:

devServer: {
    // contentBase: "./public",
    static:'./public',
}
页: [1]
查看完整版本: [webpack-cli] Invalid options object. Dev Server has been initialized using a...