I'm using webpack 3.10 and I've got different webpack configs for dev/prod. Now in my prod config "devtool = "(none)"" is set, while in my dev config it is "eval-source-map".
Sadly using the prod config, my bundle is non functional. While using the dev config everything is working fine. I tried around a bit and every setting that is flagged as "production: yes" on in the webpack docs: https://webpack.js.org/configuration/devtool/ breaks my code.
Can anyone explain the exact difference between the settings. Is there anything else that changes (minifying/uglyfying whatever)?
Kind regards.
Using Webpack, specifying devtool: "source-map" in your Webpack config will enable source maps, and Webpack will output a sourceMappingURL directive in your final, minified file.
If we aim to use source map in production, we can use source-map value for devtool . module. exports = { mode: "development", devtool: "source-map", }; Here, webpack stores the source map in a different file.
In webpack 5.2.0
, you can declare the config as devtool: false
in production for the (none)
functionality.
NOTE: If you have mode: "development"
and you do not mention devtool
in your webpack config, the devtool defaults to eval
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With