EvalSourceMapDevToolPlugin
The following options are supported:
test
(string|regex|array
): Include source maps for modules based on their extension (defaults to.js
and.css
).include
(string|regex|array
): Include source maps for module paths that match the given value.filename
(string
): Defines the output filename of the SourceMap (will be inlined if no value is provided).append
(string
): Appends the given value to the original asset. Usually the#sourceMappingURL
comment.[url]
is replaced with a URL to the source map file. disables the appending.moduleFilenameTemplate
(string
): Seeoutput.devtoolModuleFilenameTemplate
.sourceURLTemplate
: Define the sourceURL default:webpack-internal:///${module.identifier}
module
(boolean
): Indicates whether loaders should generate source maps (defaults totrue
).columns
(boolean
): Indicates whether column mappings should be used (defaults totrue
).protocol
(string
): Allows user to override default protocol (webpack-internal://
)
Examples
The following examples demonstrate some common use cases for this plugin.
You can use the following code to replace the configuration option devtool: eval-source-map
with an equivalent custom plugin configuration:
module.exports = {
// ...
plugins: [
new webpack.EvalSourceMapDevToolPlugin({})
]
};
Set a URL for source maps. Useful for avoiding cross-origin issues such as:
A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://fb.me/react-crossorigin-error for more information.
The option can be set to a function:
new webpack.EvalSourceMapDevToolPlugin({
});