Skip to content

Commit a0c29bf

Browse files
alan-agius4filipesilva
authored andcommitted
refactor(@ngtools/webpack): use webpack API to delete assets in compilation
1 parent ac66e40 commit a0c29bf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/ngtools/webpack/src/resource_loader.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,11 @@ export class WebpackResourceLoader {
204204
() => {
205205
finalContent = childCompilation.assets[outputFilePath]?.source().toString();
206206

207-
delete childCompilation.assets[outputFilePath];
208-
delete childCompilation.assets[outputFilePath + '.map'];
207+
for (const { files } of childCompilation.chunks) {
208+
for (const file of files) {
209+
childCompilation.deleteAsset(file);
210+
}
211+
}
209212
},
210213
);
211214
});

0 commit comments

Comments
 (0)