fix(compiler): various squashed fixes for the new ngc
introduce the option `allowEmptyCodegenFiles` to generate all generated files, even if they are empty. - also provides the original source files from which the file was generated in the write file callback - needed e.g. for G3 when copying over pinto mod names from the original component to all generated files use `importAs` from flat modules when writing summaries - i.e. prevents incorrect entries like @angular/common/common in the .ngsummary.json files. change interaction between ng and ts to prevent race conditions - before Angular would rely on TS to first read the file for which we generate files, and then the generated files. However, this can break easily when we reuse an old program. don’t generate files for sources that are outside of `rootDir` (see #19337)
This commit is contained in:

committed by
Victor Berchet

parent
13613d4acb
commit
a8a9660112
@ -42,13 +42,14 @@ export class StyleCompiler {
|
||||
styleUrls: template.styleUrls,
|
||||
moduleUrl: identifierModuleUrl(comp.type)
|
||||
}),
|
||||
true);
|
||||
this.needsStyleShim(comp), true);
|
||||
}
|
||||
|
||||
compileStyles(
|
||||
outputCtx: OutputContext, comp: CompileDirectiveMetadata,
|
||||
stylesheet: CompileStylesheetMetadata): CompiledStylesheet {
|
||||
return this._compileStyles(outputCtx, comp, stylesheet, false);
|
||||
stylesheet: CompileStylesheetMetadata,
|
||||
shim: boolean = this.needsStyleShim(comp)): CompiledStylesheet {
|
||||
return this._compileStyles(outputCtx, comp, stylesheet, shim, false);
|
||||
}
|
||||
|
||||
needsStyleShim(comp: CompileDirectiveMetadata): boolean {
|
||||
@ -57,8 +58,8 @@ export class StyleCompiler {
|
||||
|
||||
private _compileStyles(
|
||||
outputCtx: OutputContext, comp: CompileDirectiveMetadata,
|
||||
stylesheet: CompileStylesheetMetadata, isComponentStylesheet: boolean): CompiledStylesheet {
|
||||
const shim = this.needsStyleShim(comp);
|
||||
stylesheet: CompileStylesheetMetadata, shim: boolean,
|
||||
isComponentStylesheet: boolean): CompiledStylesheet {
|
||||
const styleExpressions: o.Expression[] =
|
||||
stylesheet.styles.map(plainStyle => o.literal(this._shimIfNeeded(plainStyle, shim)));
|
||||
const dependencies: StylesCompileDependency[] = [];
|
||||
|
Reference in New Issue
Block a user