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 code coverage mapping to src/browser-polyfill.js #348

Open
rpl opened this issue Nov 3, 2021 · 1 comment
Open

Fix code coverage mapping to src/browser-polyfill.js #348

rpl opened this issue Nov 3, 2021 · 1 comment

Comments

@rpl
Copy link
Member

rpl commented Nov 3, 2021

As a follow up to #345 we should fix the sourcemap-based code coverage remapping to make sure it does map correctly with the original source code in src/browser-polyfill.js.

At the moment it isn't the case because the sourcemap is generated by babel when we convert the polyfill script into an umd module, but after the grunt replace plugin has interpolated the content of api-metadata.json into it, which is what prevents the sourcemap-based code coverage to map to the original source code.

As an alternative approach to the grunt replace plugin, we could use a small custom babel plugin to inject the api-metadata.json into the source file, which should allow babel to generate a sourcemap file that maps to the original source instead of the intermediate interpolated file.

@fregante
Copy link
Contributor

I suggest using a regular build tool that takes care of all of this, sourcemaps would be handled by a single tool. A stable and lightweight solution would be rollup. UMD output is native, the JSON file would be plain import, banners are also supported.

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

No branches or pull requests

2 participants