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

Option to disable fallback to line #163

Open
krisselden opened this issue Oct 4, 2016 · 1 comment
Open

Option to disable fallback to line #163

krisselden opened this issue Oct 4, 2016 · 1 comment

Comments

@krisselden
Copy link

There is an issue when sorcery a low resolution map for generated source like a magic-string edit tracing back through a higher resolution map like one produced by uglify or typescript. It will loose lots of mappings.

The workaround in rollup is to generate mappings for all AST nodes and then only keep them if the trace back to something, thus the extra resolution drops out.

The problem with that approach is the extra mappings will be mapped back to the start of the line, this not only confuses the debugger but is massively confusing if the start of the line has a name entry.

https://github.com/Rich-Harris/sorcery/blob/master/src/Node.js#L156

I'd rather sorcery be able to assume the low res map just has the edits and use that to offset the mappings in the previous map instead of having to get all the sources at the exact same resolution.

Also, is there a reason code isn't shared between rollup and sorcery? It looks roughly about the same.

@aleclarson
Copy link

I'd rather sorcery be able to assume the low res map just has the edits and use that to offset the mappings in the previous map instead of having to get all the sources at the exact same resolution.

Give this a test drive if you get the chance. Thanks!

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

No branches or pull requests

2 participants