-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@angular-devkit/build-angular): improve sourcemaps fidelity when code coverage is enabled #22016
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(@angular-devkit/build-angular): improve sourcemaps fidelity when code coverage is enabled #22016
Conversation
@@ -240,16 +238,10 @@ export default custom<AngularCustomOptions>(() => { | |||
// `@ampproject/remapping` source map objects but both are compatible with Webpack. | |||
// This method for merging is used because it provides more accurate output | |||
// and is faster while using less memory. | |||
result.map = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer needed since there is a single babel pass!
packages/angular_devkit/build_angular/src/webpack/utils/helpers.ts
Outdated
Show resolved
Hide resolved
@alan-agius4 this PR has conflicts, can you resolve them please? |
…code coverage is enabled With this change we replace `@jsdevtools/coverage-istanbul-loader` webpack loader with [`babel-plugin-istanbul`](https://github.com/istanbuljs/babel-plugin-istanbul) which is an official Babel plugin by the istanbuljs team. Previously, when code coverage was enabled we had multiple Babel runs on the same file. This is because istanbuljs' `instrumentSync` and `instrument` APIs which are used by the Webpack plugin invokes Babel directly https://github.com/istanbuljs/istanbuljs/blob/66bc39b3c7b301a4b4456101a9996f90b1638dc0/packages/istanbul-lib-instrument/src/instrumenter.js#L98 By using the babel plugin directly, we avoid this which also improves the sourcemaps correctness and test performance. Closes #22010
@filipesilva done. |
@alan-agius4 13.0.x still has merge conflicts, think you need separate PRs |
@filipesilva open a separate pr for rc branch |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
With this change we replace
@jsdevtools/coverage-istanbul-loader
webpack loader withbabel-plugin-istanbul
which is an official Babel plugin by the istanbuljs team.Previously, when code coverage was enabled we had multiple Babel runs on the same file. This is because istanbuljs'
instrumentSync
andinstrument
APIs which are used by the Webpack plugin invokes Babel directly https://github.com/istanbuljs/istanbuljs/blob/66bc39b3c7b301a4b4456101a9996f90b1638dc0/packages/istanbul-lib-instrument/src/instrumenter.js#L98By using the babel plugin directly, we avoid this which also improves the sourcemaps correctness and test performance.
Closes #22010