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: pass sourcemap into Rollup treeShakingPlugin #890

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

aleclarson
Copy link

Fixes #889

@codesandbox
Copy link

codesandbox bot commented Apr 21, 2023

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@vercel
Copy link

vercel bot commented Apr 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 21, 2023 4:44pm

@aleclarson
Copy link
Author

Hmm, still not producing correct sourcemaps...

Could be something to do with:

tsup/src/plugin.ts

Lines 156 to 166 in 322cb77

if (result.map) {
const originalConsumer = await new SourceMapConsumer(
parseSourceMap(info.map)
)
const newConsumer = await new SourceMapConsumer(
parseSourceMap(result.map)
)
const generator =
SourceMapGenerator.fromSourceMap(originalConsumer)
generator.applySourceMap(newConsumer, info.path)
info.map = generator.toJSON()

…or maybe it's a Rollup bug?

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.

Sourcemaps break when using treeshake: 'smallest'
1 participant