From e7dbb316624827fa2f0a7ad3d3a4ee90e3127628 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 25 Feb 2020 11:55:56 -0500 Subject: [PATCH] fix(@ngtools/webpack): always use VE for deprecated string route discovery When in JIT mode during lazy route discovery, the Ivy compiler willl attempt to parse templates which may fail when this plugin is used with webpack loaders that support custom template formats. The string lazy routes must be discovered before the webpack build starts but the template loading/processing does not occur until the webpack build commences. Fixes: #17002 --- packages/ngtools/webpack/src/angular_compiler_plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ngtools/webpack/src/angular_compiler_plugin.ts b/packages/ngtools/webpack/src/angular_compiler_plugin.ts index 264bebbaeb6d..37a68793940b 100644 --- a/packages/ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/ngtools/webpack/src/angular_compiler_plugin.ts @@ -470,7 +470,7 @@ export class AngularCompilerPlugin { time('AngularCompilerPlugin._listLazyRoutesFromProgram.createProgram'); ngProgram = createProgram({ rootNames: this._rootNames, - options: { ...this._compilerOptions, genDir: '', collectAllErrors: true }, + options: { ...this._compilerOptions, genDir: '', collectAllErrors: true, enableIvy: false }, host: this._compilerHost, }); timeEnd('AngularCompilerPlugin._listLazyRoutesFromProgram.createProgram');