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) Clear outDir if set in tsconfig #406

Merged
merged 2 commits into from
Sep 20, 2021

Conversation

dimfeld
Copy link
Contributor

@dimfeld dimfeld commented Sep 10, 2021

As mentioned in #405. Since it's a quick fix I decided to just submit the PR before any discussion. Happy to discuss more if you're not sure if this is the right thing to do.

If outDir is set, Typescript sets directories in the source maps relative to it
which causes problems in concatSourceMaps when the paths in the source
point to nonexistent files instead of the virtual modules set up by the
transformer.

Tested against /~https://github.com/dimfeld/svelte-preprocess-injected-bug and also added a new unit test.

Fixes #405

If outDir is set, Typescript sets directories in the source maps relative to it
which causes problems in `concatSourceMaps` when the paths in the source
point to nonexistent files instead of the virtual modules set up by the
transformer.

Fixes sveltejs#405
Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in the linked issue, this is a good solution for me.

@kaisermann kaisermann merged commit 67f96ad into sveltejs:main Sep 20, 2021
@kaisermann
Copy link
Member

Thanks 🎉 Released in v4.9.5

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.

Typescript processing breaks when tsconfig has outDir set
3 participants