我在使用最新版本的 Webpack (5.1.0) 时遇到错误。看起来配置正在抛出错误,因为验证架构过于严格。这是我的 webpack 配置文件的要点,以及我看到的错误消息。
webpack.config.js
https://gist.github.com/adarshbhat/3ec5950b66b78102da0cf46e51a3d633
错误
[webpack-cli]
Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.node should be one of these:
false | object { __dirname?, __filename?, global? }
-> Include polyfills or mocks for various node stuff.
Details:
* configuration.node has an unknown property 'module'. These properties are valid:
object { __dirname?, __filename?, global? }
-> Options object for node compatibility features.
* configuration.node has …Run Code Online (Sandbox Code Playgroud)