Skip to content

Commit 37bc9ba

Browse files
committed
fix(@ngtools/webpack): wait for plugin when resolving ts requests
Fix angular#5137
1 parent d6c07c7 commit 37bc9ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/@ngtools/webpack/src/plugin.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,11 @@ export class AotPlugin implements Tapable {
378378

379379
compiler.plugin('after-resolvers', (compiler: any) => {
380380
// Virtual file system.
381+
// Wait for the plugin to be done when requesting `.ts` files directly (entry points), or
382+
// when the issuer is a `.ts` file.
381383
compiler.resolvers.normal.plugin('before-resolve', (request: any, cb: () => void) => {
382-
if (request.request.match(/\.ts$/)) {
384+
if (request.request.endsWith('.ts')
385+
|| (request.context.issuer && request.context.issuer.endsWith('.ts'))) {
383386
this.done!.then(() => cb(), () => cb());
384387
} else {
385388
cb();

0 commit comments

Comments
 (0)