diff --git a/packages/angular_devkit/build_angular/test/browser/lazy-module_spec_large.ts b/packages/angular_devkit/build_angular/test/browser/lazy-module_spec_large.ts index c6dbf303f186..001751bb86d2 100644 --- a/packages/angular_devkit/build_angular/test/browser/lazy-module_spec_large.ts +++ b/packages/angular_devkit/build_angular/test/browser/lazy-module_spec_large.ts @@ -142,7 +142,7 @@ describe('Browser Builder lazy modules', () => { tap((buildEvent) => expect(buildEvent.success).toBe(true)), tap(() => { expect(host.scopedSync() - .exists(join(outputPath, 'lazy-lazy-module.js'))).toBe(true); + .exists(join(outputPath, 'lazy-lazy-module-ngfactory.js'))).toBe(true); }), ).toPromise().then(done, done.fail); }); @@ -301,7 +301,7 @@ describe('Browser Builder lazy modules', () => { runTargetSpec(host, browserTargetSpec, overrides, DefaultTimeout * 2).pipe( tap((buildEvent) => expect(buildEvent.success).toBe(true)), tap(() => expect(host.scopedSync() - .exists(join(outputPath, 'src-app-lazy-lazy-module.js'))) + .exists(join(outputPath, 'src-app-lazy-lazy-module-ngfactory.js'))) .toBe(true)), ).toPromise().then(done, done.fail); }); diff --git a/packages/ngtools/webpack/src/angular_compiler_plugin.ts b/packages/ngtools/webpack/src/angular_compiler_plugin.ts index af5a4c78ea69..bc8c4daf2e01 100644 --- a/packages/ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/ngtools/webpack/src/angular_compiler_plugin.ts @@ -696,9 +696,8 @@ export class AngularCompilerPlugin { const dependencies = Object.keys(this._lazyRoutes) .map((key) => { const modulePath = this._lazyRoutes[key]; - const importPath = key.split('#')[0]; if (modulePath !== null) { - const name = importPath.replace(/(\.ngfactory)?(\.(js|ts))?$/, ''); + const name = key.split('#')[0]; return new this._contextElementDependencyConstructor(modulePath, name); } else {