Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
fix(@ngtools/webpack): add check for request parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sumbad authored and filipesilva committed May 10, 2018
1 parent 8b5b9a1 commit e335e5d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/ngtools/webpack/src/angular_compiler_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,9 @@ export class AngularCompilerPlugin {
// Wait for the plugin to be done when requesting `.ts` files directly (entry points), or
// when the issuer is a `.ts` or `.ngfactory.js` file.
nmf.hooks.beforeResolve.tapAsync('angular-compiler', (request: any, callback: any) => {
if (this.done && (request.request.endsWith('.ts')
|| (request.context.issuer && /\.ts|ngfactory\.js$/.test(request.context.issuer)))) {
if (this.done && (request && request.request.endsWith('.ts')
|| (request && request.context.issuer
&& /\.ts|ngfactory\.js$/.test(request.context.issuer)))) {
this.done.then(() => callback(null, request), () => callback(null, request));
} else {
callback(null, request);
Expand Down

0 comments on commit e335e5d

Please sign in to comment.