Skip to content

Commit

Permalink
docs: update SourceMapDevToolPlugin en
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Apr 17, 2024
1 parent 32ac36e commit 60ed529
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions website/docs/en/plugins/webpack/source-map-dev-tool-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,28 @@ new rspack.SourceMapDevToolPlugin(options);

## Options

- `test` (`string` `RegExp` `[string, RegExp]`): Include source maps for modules based on their extension (defaults to .js, .mjs, and .css).
- `test` (`string` `RegExp` `[string, RegExp]`): Include source maps for modules based on their extension (defaults to `.js`, `.mjs`, and `.css`).
- `include` (`string` `RegExp` `[string, RegExp]`): Include source maps for module paths that match the given value.
- `exclude` (`string` `RegExp` `[string, RegExp]`): Exclude modules that match the given value from source map generation.
- `filename` (`string`): Defines the output filename of the SourceMap (will be inlined if no value is provided).
- `append` (`string` `function`): Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. Path parameters are supported: [chunk], [filename] and [contenthash]. Setting append to false disables the appending.
- `append` (`string` `function`): Appends the given value to the original asset. Usually the `#sourceMappingURL` comment. `[url]` is replaced with a URL to the source map file. Path parameters are supported: `[chunk]`, `[filename]` and `[contenthash]`. Setting append to false disables the appending.
- `moduleFilenameTemplate` (`string`): See [`output.devtoolModuleFilenameTemplate`](/en/config/output.html#outputdevtoolmodulefilenametemplate).
- `fallbackModuleFilenameTemplate` (`string`): See link above.
- `namespace` (`string`): See [`output.devtoolNamespace`](/en/config/output.html#outputdevtoolnamespace).
- `module = true` (`boolean`): Indicates whether loaders should generate source maps.
- `columns = true` (`boolean`): Indicates whether column mappings should be used.
- `noSources = false` (`boolean`): Prevents the source file content from being included in the source map.
- `publicPath` (`string`): Emits absolute URLs with public path prefix, e.g. https://example.com/project/.
- `fileContext` (`string`): Makes the [file] argument relative to this directory.
- `sourceRoot` (`string`): Provide a custom value for the sourceRoot property in the SourceMap.
- `publicPath` (`string`): Emits absolute URLs with public path prefix, e.g. `https://example.com/project/`.
- `fileContext` (`string`): Makes the `[file]` argument relative to this directory.
- `sourceRoot` (`string`): Provide a custom value for the `sourceRoot` property in the SourceMap.

:::tip
Setting `module` and/or `columns` to `false` will yield less accurate source maps but will also improve compilation performance significantly.
:::

:::tip
If you want to use a custom configuration for this plugin in [development mode](/config/mode#development), make sure to disable the default one. I.e. set `devtool: false`.
:::

## Examples

Expand Down

0 comments on commit 60ed529

Please sign in to comment.