Skip to content

Commit 9cf055e

Browse files
filipesilvahansl
authored andcommitted
fix(@ngtools/webpack): don't add resource sourcemap to parent compilation
Fix angular#9980
1 parent be89128 commit 9cf055e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/resource_loader.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@ export class WebpackResourceLoader {
102102
reject(err);
103103
} else {
104104
Object.keys(childCompilation.assets).forEach(assetName => {
105-
if (assetName !== filePath && this._parentCompilation.assets[assetName] == undefined) {
105+
// Add all new assets to the parent compilation, with the exception of
106+
// the file we're loading and its sourcemap.
107+
if (
108+
assetName !== filePath
109+
&& assetName !== `${filePath}.map`
110+
&& this._parentCompilation.assets[assetName] == undefined
111+
) {
106112
this._parentCompilation.assets[assetName] = childCompilation.assets[assetName];
107113
}
108114
});

0 commit comments

Comments
 (0)