> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# output.sourceMap

- **Type:**

```ts
type SourceMap =
  | boolean
  | {
      js?: Rspack.Configuration['devtool'];
      css?: boolean;
    };
```

- **Default:**

```ts
const defaultSourceMap = {
  js: isDev ? 'cheap-module-source-map' : 'hidden-source-map',
  css: isDev,
};
```

When `output.sourceMap` is not configured, the source map generation rules of Modern.js are different from Rsbuild:

- In the development mode, JS and CSS source maps are generated for development debugging.
- In the production mode, JS source maps are generated for stack trace backtracking, and CSS source maps are not generated to provide the best build performance.

:::info
The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to [Rsbuild - output.sourceMap](https://v2.rsbuild.dev/config/output/source-map).
:::