Defaults
The bundler’sdevtool setting controls source map output. Extension.js picks it from the command, and both manifest versions get the same value:
Neither manifest version gets an eval variant, so the bundle runs under your extension’s own CSP.
extension build --source-maps writes source-map files beside a production build. Releases before 4.1.13 used cheap-source-map in development, and eval-cheap-source-map on manifest v2.
See your original TypeScript
The dev default,cheap-module-source-map, keeps every loader map, so DevTools opens your TypeScript and not the compiled JavaScript. It maps lines, not columns. When you also want column positions, switch to source-map through the config hook in extension.config.js, at a slower rebuild cost:
extension.config.js
dev and build alike, so the override applies everywhere.
Then find each context in its own inspector:
- Background service worker: open
chrome://extensions, choose your extension, and follow the service worker link under “Inspect views”. Your original files appear in the Sources panel. - Content scripts: open DevTools on the page itself. In the Sources panel, the Content scripts tab lists your extension. If the separate
.mapfile fails to load there, an inline variant such asinline-cheap-module-source-mapembeds the map in the emitted file. - Popup, options, sidebar: right-click inside the surface and choose Inspect.
extension.js/, for example webpack://my-extension/extension.js/node_modules/@rspack/core/hot/log.js. Your own files and the packages your project installs keep their usual names, so a frame under extension.js/ points at the toolchain and not at your code.
For the terminal-first version of the same session, see Debugging.
Eval devtools and extension CSP
Everydevtool value that starts with eval wraps modules in eval() calls. Manifest v3 extension pages and service workers reject 'unsafe-eval' in their CSP, on every build, so those values break the background and extension pages outright. Symptoms are CSP refusal errors and an extension that never boots.
On manifest v3, choose from the non-eval family:
cheap-source-mapcheap-module-source-map(the dev default)source-mapinline-cheap-module-source-mapand otherinline-*variantshidden-source-mapandnosources-source-map
extension dev because of the patched dev CSP. Production manifest v2 builds get no such patch, which is one more reason production defaults to no maps at all.
Production builds
extension build runs in production mode by default and emits no source maps. That keeps store artifacts small and keeps your original source out of shipped packages.
To debug a production-shaped bundle locally, either cut a development-mode build:
devtool in the config hook, which production builds honor too. If you enable maps for a build that leaves your machine, prefer hidden-source-map: it emits .map files without advertising them in the bundle.
Best practices
- Keep the defaults during normal dev: They map back to your source and stay within extension CSP.
- Reach for
source-mapwhen you need column positions: The default already maps back to your original TypeScript, by line. - Never ship eval devtools in a manifest v3 project: The extension fails CSP before your first breakpoint.
- Leave production maps off for store submissions: Enable them only for local diagnosis.
Next steps
- Change bundler settings in Rspack configuration.
- Drive a live session from the terminal in Debugging.
- Review build output in the build command.

