Skip to content

Commit 430ee44

Browse files
clydinfilipesilva
authored andcommitted
fix(@ngtools/webpack): use correct Webpack asset stage in resource loader
The asset extraction within the Angular compiler plugin resource loader needs to occur at the end of the Webpack asset processing pipeline. This ensures that all analysis and preprocessing of the asset have been performed before the resource asset is extracted from the Webpack child compilation.
1 parent 183528d commit 430ee44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/ngtools/webpack/src/resource_loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class WebpackResourceLoader {
136136
if (isWebpackFiveOrHigher()) {
137137
childCompiler.hooks.compilation.tap('angular-compiler', (childCompilation) => {
138138
// tslint:disable-next-line: no-any
139-
(childCompilation.hooks as any).processAssets.tap('angular-compiler', () => {
139+
(childCompilation.hooks as any).processAssets.tap({name: 'angular-compiler', stage: 5000}, () => {
140140
finalContent = childCompilation.assets[filePath]?.source().toString();
141141
finalMap = childCompilation.assets[filePath + '.map']?.source().toString();
142142

0 commit comments

Comments
 (0)