SourceMapDevToolPlugin
SourceMapDevToolPlugin
This plugin enables a more fine grained control of source maps added via the devtool
option.
new webpack.SourceMapDevToolPlugin(options)
Options
The following options are supported:
-
options.test
/options.include
/options.exclude
(string|RegExp|Array
): Used to determine which assets should be processed. Each one can be aRegExp
(asset filename is matched), astring
(asset filename need to start with this string) or anArray
of those (any of them need to be matched).test
defaults to.js
and.css
files if omitted. -
options.filename
(string
): defines the output filename of the SourceMap. If no value is provided the source map is inlined. -
options.append
(string
): is appended to the original asset. Usually the#sourceMappingURL
comment.[url]
is replaced with a URL to the source map file.false
disables the appending. -
options.moduleFilenameTemplate
/options.fallbackModuleFilenameTemplate
(string
): seeoutput.devtoolModuleFilenameTemplate
. -
options.module
(boolean
): (defaults totrue
) Whenfalse
loaders do not generate source maps and the transformed code is used as source instead. -
options.columns
(boolean
): (defaults totrue
) Whenfalse
column mappings in source maps are ignored and a faster source map implementation is used. -
options.lineToLine
({test: string|RegExp|Array, include: string|RegExp|Array, exclude: string|RegExp|Array}
matched modules uses simple (faster) line to line source mappings.
Usage: Exclude Vendor Maps
The following code would exclude source maps for any modules in the vendor.js
bundle:
new webpack.SourceMapDevToolPlugin({ filename: '[name].js.map', exclude: ['vendor.js'] })
Further Reading
© JS Foundation and other contributors
Licensed under the Creative Commons Attribution License 4.0.
https://webpack.js.org/plugins/source-map-dev-tool-plugin