Skip to content

Commit e52a7b8

Browse files
chore: add more documentation for configuring source maps properly (#6119)
* chore: add more documentation for configuring source maps properly * Update docs/app/guides/debugging.mdx * fix lint
1 parent 8ee76ce commit e52a7b8

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

docs/app/guides/debugging.mdx

+21-5
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,27 @@ inline source maps, you will not see code frames.
206206
By default, Cypress will include an inline source map in your spec file, so you
207207
will get the most out of the error experience. If you
208208
[modify the preprocessor](/api/node-events/preprocessors-api), ensure that inline
209-
source maps are enabled to get the same experience. With webpack and the
210-
[webpack preprocessor](https://github.com/cypress-io/cypress/tree/develop/npm/webpack-preprocessor),
211-
for example, set
212-
[the `devtool` option](https://webpack.js.org/configuration/devtool/) to
213-
`inline-source-map`.
209+
source maps are enabled to get the same experience. Some examples of this include:
210+
211+
- With webpack and the
212+
[webpack preprocessor](https://github.com/cypress-io/cypress/tree/develop/npm/webpack-preprocessor), set
213+
[the `devtool` option](https://webpack.js.org/configuration/devtool/) to
214+
`inline-source-map`.
215+
- With esbuild and the
216+
[esbuild preprocessor](https://github.com/bahmutov/cypress-esbuild-preprocessor/tree/main), set
217+
[the `sourcemap` option](https://esbuild.github.io/api/#sourcemap) to `inline` when
218+
[creating the bundler](https://github.com/bahmutov/cypress-esbuild-preprocessor#esbuild-options).
219+
- With cucumber and the
220+
[cucumber preprocessor](https://github.com/badeball/cypress-cucumber-preprocessor/tree/master)
221+
third party bundlers are used to bundle the code.
222+
- For esbuild and the
223+
[esbuild preprocessor](https://github.com/bahmutov/cypress-esbuild-preprocessor/tree/main),
224+
set [the `sourcemap` option](https://esbuild.github.io/api/#sourcemap) to `inline` when
225+
[creating the bundler](https://github.com/bahmutov/cypress-esbuild-preprocessor#esbuild-options).
226+
Note: the cucumber preprocessor documentation for the esbuild bundler describes an experimental
227+
option: `prettySourceMaps`, but this option is buggy and setting source maps on the esbuild
228+
bundler directly works better.
229+
- The other bundlers all default their source maps appropriately.
214230

215231
## Debugging flake
216232

0 commit comments

Comments
 (0)