Skip to content

Commit

Permalink
fix(@ngtools/webpack): use correct Webpack asset stage in resource lo…
Browse files Browse the repository at this point in the history
…ader

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.
  • Loading branch information
clydin authored and filipesilva committed Mar 31, 2021
1 parent 183528d commit 430ee44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/src/resource_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class WebpackResourceLoader {
if (isWebpackFiveOrHigher()) {
childCompiler.hooks.compilation.tap('angular-compiler', (childCompilation) => {
// tslint:disable-next-line: no-any
(childCompilation.hooks as any).processAssets.tap('angular-compiler', () => {
(childCompilation.hooks as any).processAssets.tap({name: 'angular-compiler', stage: 5000}, () => {
finalContent = childCompilation.assets[filePath]?.source().toString();
finalMap = childCompilation.assets[filePath + '.map']?.source().toString();

Expand Down

0 comments on commit 430ee44

Please sign in to comment.