-
Notifications
You must be signed in to change notification settings - Fork 16
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!: Fix source map #113
fix!: Fix source map #113
Conversation
Hello @kota65535, thanks for the PR. Nice solution, there is just one thing that might need a bit looking into. The dependency of esprima is a bit dangerous as it's last update was 5 years ago (jquery/esprima#2122). However as there is a package that is based on esprima called espree that seems to have somewhat of the same API. I will setup some test projects when i have some free time during next week or so to test the solution with both esprima and espree to see if they both solve the issue with the incorrect source mappings. |
Hi @iFaxity, thank you for taking a look! |
Changing this from a fix to a breaking change when merging. As it is hard to know this will impact projects. |
🎉 This PR is included in version 5.0.0-rc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* fix sourcemap line number * fix comment * use espree * fix function name
* fix sourcemap line number * fix comment * use espree * fix function name
fix: #101
Currently, this plugin returns the source map combined with the source maps of all previous plugins.
This means that the source maps are combined twice because they are also combined outside the plugins later (here), which leads to incorrect line numbers.
This PR changes to call
instrumenter.instrumentSync
twice to create the source map and the instrumented code separately.