website/docs/en/plugins/webpack/eval-source-map-dev-tool-plugin.mdx
import WebpackLicense from '@components/WebpackLicense';
<WebpackLicense from="https://webpack.js.org/plugins/eval-source-map-dev-tool-plugin/" />This plugin enables more fine grained control of source map generation. It is also enabled automatically by certain settings of the devtool configuration option.
new webpack.EvalSourceMapDevToolPlugin(options);
string RegExp [string, RegExp]Include source maps for modules based on their extension (defaults to .js, .mjs, and .css).
string RegExp [string, RegExp]Include source maps for module paths that match the given value.
string RegExp [string, RegExp]Exclude modules that match the given value from source map generation.
string | functionAppends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.
booleanIndicates whether loaders should generate source maps (defaults to true).
booleanIndicates whether column mappings should be used (defaults to true).
You can use the following code to replace the configuration option devtool: eval-source-map with an equivalent custom plugin configuration:
import { rspack } from '@rspack/core';
export default {
devtool: false,
plugins: [new rspack.EvalSourceMapDevToolPlugin({})],
};
The following code would exclude source maps for any modules in the vendor.js bundle:
new rspack.EvalSourceMapDevToolPlugin({
exclude: ['vendor.js'],
});