For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/rspeedy/rspeedy.sourcemap.js.md.
Rspeedy logo
Rspeedy
  • 简体中文
  • 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`;

    Default Value

    When output.sourceMap is an object and js is unset, it defaults to 'cheap-module-source-map' in development. In production, it defaults to 'source-map' for Lynx environments and false otherwise.

    Remarks

    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 许可协议进行许可。