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;

Remarks

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',
    },
  },
})
除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。