Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

devtool and SourceMapDevToolPlugin,are they all needed?

Tags:

webpack

If I have used SourceMapDevToolPlugin to make a configuration for sourcemap,do I still need to add a devtool key in webpack.config.js?

like image 413
zzzgoo Avatar asked Apr 13 '26 18:04

zzzgoo


1 Answers

No, you don't need to if you are satisfied with the generated source maps with the current configuration.

SourceMapDevToolPlugin gives you a little bit more control over generating source maps. With the plugin you can generate source maps only for the portions of your code. It allows you to specify which files to match using regular expression for instance (exactly as with loaders).

With devtool property, webpack matches only .js and .css files by default and it generates source map for every module. Under the hood it maps to the SourceMapDevToolPlugin.

like image 147
Adam Wolski Avatar answered Apr 15 '26 06:04

Adam Wolski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!