refactor(compiler): don’t always compile .ngfactory.ts
files by default
This puts the behavior introduced in 573b8611bc
behind the new flag
`alwaysCompileGeneratedCode` to not break users that might have relied
on this behavior.
This commit is contained in:

committed by
Alex Rickabaugh

parent
6ca46929fa
commit
ed73d4f3ac
@ -124,8 +124,11 @@ export function main(
|
||||
if (diagnostics) console.time('NG codegen');
|
||||
return codegen(ngOptions, cliOptions, program, host).then((genFiles) => {
|
||||
if (diagnostics) console.timeEnd('NG codegen');
|
||||
|
||||
// Add the generated files to the configuration so they will become part of the program.
|
||||
genFiles.forEach(genFileName => addGeneratedFileName(genFileName));
|
||||
if (ngOptions.alwaysCompileGeneratedCode) {
|
||||
genFiles.forEach(genFileName => addGeneratedFileName(genFileName));
|
||||
}
|
||||
let definitionsHost: ts.CompilerHost = tsickleCompilerHost;
|
||||
if (!ngOptions.skipMetadataEmit) {
|
||||
// if tsickle is not not used for emitting, but we do use the MetadataWriterHost,
|
||||
|
@ -83,8 +83,13 @@ interface Options extends ts.CompilerOptions {
|
||||
enableLegacyTemplate?: boolean;
|
||||
|
||||
// Whether to generate .ngsummary.ts files that allow to use AOTed artifacts
|
||||
// in JIT mode.
|
||||
// in JIT mode. This is off by default.
|
||||
enableSummariesForJit?: boolean;
|
||||
|
||||
// Whether to compile generated .ngfacgtory.ts files, even when they are no
|
||||
// matched by the `files` / `includes` in the `tsconfig.json`.
|
||||
// This is off by default.
|
||||
alwaysCompileGeneratedCode?: boolean;
|
||||
}
|
||||
|
||||
export default Options;
|
||||
|
Reference in New Issue
Block a user