perf(core): add option to remove blank text nodes from compiled templates (#18823)
PR Close #18823
This commit is contained in:

committed by
Miško Hevery

parent
7ec28fe9af
commit
b8b551cf2b
@ -104,6 +104,7 @@ export class CodeGenerator {
|
||||
locale: cliOptions.locale, missingTranslation,
|
||||
enableLegacyTemplate: options.enableLegacyTemplate !== false,
|
||||
enableSummariesForJit: options.enableSummariesForJit !== false,
|
||||
preserveWhitespaces: options.preserveWhitespaces,
|
||||
});
|
||||
return new CodeGenerator(options, program, tsCompilerHost, aotCompiler, ngCompilerHost);
|
||||
}
|
||||
|
@ -91,6 +91,10 @@ export interface CompilerOptions extends ts.CompilerOptions {
|
||||
|
||||
// Whether to enable support for <template> and the template attribute (true by default)
|
||||
enableLegacyTemplate?: boolean;
|
||||
|
||||
// Whether to remove blank text nodes from compiled templates. It is `true` by default
|
||||
// in Angular 4 and will be re-visited post Angular 5.
|
||||
preserveWhitespaces?: boolean;
|
||||
}
|
||||
|
||||
export interface ModuleFilenameResolver {
|
||||
|
@ -388,4 +388,4 @@ function createProgramWithStubsHost(
|
||||
fileExists = (fileName: string) =>
|
||||
this.generatedFiles.has(fileName) || originalHost.fileExists(fileName);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user