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(workspace): Fix sourcemap generation for “longer” bundles #3201

Merged
merged 5 commits into from
Apr 29, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Apr 29, 2023

Resolves #3182

Summary

It seems that during one of the past dependency upgrades sourcemap generation has slightly and subtly broken. For longer output bundles, the offset of sourcemaps would eventually be incorrect.

This was due to sourcemaps becoming broken in the cleanupPlugin, but since Rollup now provides an option for hoisted transitive imports, its use for JS output is now obsolete.

I've also noticed that we're losing a bit of sourcemap fidelity with Sucrase, and since we're already parsing all files with Babel, we can safely move to a Babel TypeScript transformer.

Set of changes

  • Upgrade Rollup dependencies
  • Replace sucrase with Babel transform
  • Remove Babel import transform from cleanup plugin
  • Disable hoistTransitiveImports in Rollup output options

@kitten kitten merged commit 390296e into main Apr 29, 2023
@kitten kitten deleted the chore/sourcemap branch April 29, 2023 14:05
@github-actions github-actions bot mentioned this pull request Apr 29, 2023
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 are generated incorrectly (exchange-graphcache)
1 participant