Skip to content

feat: enable sourcemaps and ensure that files referenced in code fram…#528

Open
ryanthemanuel wants to merge 2 commits intobahmutov:mainfrom
ryanthemanuel:sourcemap-improvements
Open

feat: enable sourcemaps and ensure that files referenced in code fram…#528
ryanthemanuel wants to merge 2 commits intobahmutov:mainfrom
ryanthemanuel:sourcemap-improvements

Conversation

@ryanthemanuel
Copy link

Summary

When using the plugin with default settings, code frames are not shown when failures occur:

image

This PR updates the default sourcemap setting to inline (though this can be overridden by the user), enabling code frames to appear in error output:

image

However, due to esbuild issue #2218, sourcemap paths are generated relative to the outfile location—which, by default, ends up in a system app data directory rather than the project root. As a result, file paths in code frames are confusing, and clicking them does not open the correct file in an editor.

To resolve this, we write to a temporary outfile located next to the source file, then move the compiled file to the directory that Cypress expects after the build completes. This makes code frames usable, with correct paths that open in an IDE as expected:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant