Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix source map root #2

Merged
merged 2 commits into from
Nov 28, 2023
Merged

Fix source map root #2

merged 2 commits into from
Nov 28, 2023

Conversation

andrew0
Copy link
Contributor

@andrew0 andrew0 commented Nov 28, 2023

Fixes #1

Since tsimp provides a virtual folder to the TypeScript compiler, the output source maps will contain relative paths that might not necessarily align with the actual source files. This change sets the sourceRoot option to the resolved rootDir path from the tsconfig, which lets Node find the original source files for debugging/stack traces.

After this change, the inlined source maps contain the current working directory in the source map sourceRoot field, so I updated the snapshots tests to filter out the source map like 4f314b0

PR-URL: tapjs#2
Credit: @andrew0
Close: tapjs#2
Reviewed-by: @isaacs
@isaacs isaacs merged commit 610c01c into tapjs:main Nov 28, 2023
8 of 12 checks passed
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.

Source map paths are wrong
2 participants