Home > @lynx-js/rspeedy > SourceMap > js
SourceMap.js property
How the source map should be generated. Setting it to false
will disable the source map.
Signature:
js?: Rspack.DevTool | undefined | `${Exclude<Rspack.DevTool, false | 'eval'>}-debugids`;
Defaults to 'cheap-module-source-map'
at development, false
at production.
See Rspack - Devtool for details.
Example 1
- Enable high-quality source-maps for production:
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
output: {
sourceMap: {
js: process.env['NODE_ENV'] === 'production'
? 'source-map'
: 'cheap-module-source-map',
},
},
})
Example 2
- Disable source-map generation:
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
output: {
sourceMap: {
js: false,
},
},
})
Example 3
- Use high-quality source-maps for all environments:
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
output: {
sourceMap: {
js: 'source-map',
},
},
})