Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Fix source map generation #17

Merged
merged 3 commits into from
Jul 10, 2017
Merged

Fix source map generation #17

merged 3 commits into from
Jul 10, 2017

Conversation

klaussner
Copy link
Contributor

@klaussner klaussner commented Jul 8, 2017

This PR fixes source map generation to resolve one of the debugging issues described in meteor/meteor#8611.

The source maps that are generated by compile are wrong if at least one Babel plugin is included in the options object (see meteor/meteor#8611 (comment)). I'm not really sure why the current implementation doesn't work but it looks like it's a problem with Babel's inputSourceMap option. Instead of using an intermediate source map, I think it's fine to transform the AST twice and let Babel generate the source map from the final AST only. Another benefit is that compile doesn't have to generate code twice (once for each pass) anymore.

I have tested this change with a few combinations of Babel plugins and presets and compile always created a correct source map.

@benjamn benjamn self-requested a review July 10, 2017 16:17
@benjamn
Copy link
Contributor

benjamn commented Jul 10, 2017

Thanks a ton @klaussner!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants