Home>

I'm new to webpack.
I ran it with npx webpack, but I get an error.
I got an error after creating the webpack.config.js file.

I'm editing a config file, but even if I google
I don't know the cause of the error.

Is there a problem with webpack-cli?
Please tell me the details.
Please.

PS C: \ Users \ 81907 \ Desktop \ workspace \ tmp>npx webpack
[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 --configuration.devtool should match pattern "^ (inline- | hidden- | eval-)? (Nosources-)? (cheap- (module-)?)? Source-map $".
   BREAKING CHANGE since webpack 5: The devtool option is more strict.
   Please strictly follow the order of the keywords in the pattern.
It will be the code of webpack.config.js.
module.exports = {
  mode: "development",
  devtool:'none'
}
  • Answer # 1

    As stated in the error message.devtool:'none'Does not pass with Webpack 5.

    devtool:If you do not write itself, there will be no source map.