Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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