File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
packages/angular_devkit/build_angular/src/babel Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -239,10 +239,16 @@ export default custom<ApplicationPresetOptions>(() => {
239
239
// `@ampproject/remapping` source map objects but both are compatible with Webpack.
240
240
// This method for merging is used because it provides more accurate output
241
241
// and is faster while using less memory.
242
- result . map = remapping (
243
- [ result . map as SourceMapInput , inputSourceMap as SourceMapInput ] ,
244
- ( ) => null ,
245
- ) as typeof result . map ;
242
+ result . map = {
243
+ // Convert the SourceMap back to simple plain object.
244
+ // This is needed because otherwise code-coverage will fail with `don't know how to turn this value into a node`
245
+ // Which is thrown by Babel if it is invoked again from `istanbul-lib-instrument`.
246
+ // https://github.com/babel/babel/blob/780aa48d2a34dc55f556843074b6aed45e7eabeb/packages/babel-types/src/converters/valueToNode.ts#L115-L130
247
+ ...( remapping (
248
+ [ result . map as SourceMapInput , inputSourceMap as SourceMapInput ] ,
249
+ ( ) => null ,
250
+ ) as typeof result . map ) ,
251
+ } ;
246
252
}
247
253
248
254
return result ;
You can’t perform that action at this time.
0 commit comments