If I have used SourceMapDevToolPlugin to make a configuration for sourcemap,do I still need to add a devtool key in webpack.config.js?
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.
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