diff --git a/packages/@ngtools/webpack/src/plugin.ts b/packages/@ngtools/webpack/src/plugin.ts index 5fdf11462c02..187a5b0202fe 100644 --- a/packages/@ngtools/webpack/src/plugin.ts +++ b/packages/@ngtools/webpack/src/plugin.ts @@ -390,7 +390,7 @@ export class AotPlugin implements Tapable { // Wait for the plugin to be done when requesting `.ts` files directly (entry points), or // when the issuer is a `.ts` file. compiler.resolvers.normal.plugin('before-resolve', (request: any, cb: () => void) => { - if (request.request.endsWith('.ts') + if (this.done && request.request.endsWith('.ts') || (request.context.issuer && request.context.issuer.endsWith('.ts'))) { this.done!.then(() => cb(), () => cb()); } else {