Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@ngtools/webpack): don't use skipTemplateCodegen to determine if compilation is JIT mode #19953

Merged
merged 1 commit into from Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -59,7 +59,6 @@ function createIvyPlugin(
const optimize = buildOptions.optimization.scripts;

const compilerOptions: CompilerOptions = {
skipTemplateCodegen: !aot,
sourceMap: buildOptions.sourceMap.scripts,
};

Expand All @@ -78,6 +77,7 @@ function createIvyPlugin(
tsconfig,
compilerOptions,
fileReplacements,
jitMode: !aot,
emitNgModuleScope: !optimize,
suppressZoneJsIncompatibilityWarning: true,
});
Expand Down
4 changes: 3 additions & 1 deletion packages/ngtools/webpack/src/ivy/plugin.ts
Expand Up @@ -44,6 +44,7 @@ export interface AngularPluginOptions {
emitClassMetadata: boolean;
emitNgModuleScope: boolean;
suppressZoneJsIncompatibilityWarning: boolean;
jitMode: boolean;
}

// Add support for missing properties in Webpack types as well as the loader's file emitter
Expand Down Expand Up @@ -91,6 +92,7 @@ export class AngularWebpackPlugin {
this.pluginOptions = {
emitClassMetadata: false,
emitNgModuleScope: false,
jitMode: false,
fileReplacements: {},
substitutions: {},
directTemplateLoading: true,
Expand Down Expand Up @@ -222,7 +224,7 @@ export class AngularWebpackPlugin {
augmentHostWithSubstitutions(host, this.pluginOptions.substitutions);

// Create the file emitter used by the webpack loader
const { fileEmitter, builder, internalFiles } = compilerOptions.skipTemplateCodegen
const { fileEmitter, builder, internalFiles } = this.pluginOptions.jitMode
? this.updateJitProgram(compilerOptions, rootNames, host, diagnosticsReporter)
: this.updateAotProgram(
compilerOptions,
Expand Down