feat(compiler-cli): add watch mode to ngc
(#18818)
With this change ngc now accepts a `-w` or a `--watch` command-line option that will automatically perform a recompile whenever any source files change on disk. PR Close #18818
This commit is contained in:

committed by
Jason Aden

parent
c685cc2f0a
commit
06d01b2287
@ -39,12 +39,13 @@ describe('ng type checker', () => {
|
||||
if (!diagnostics || !diagnostics.length) {
|
||||
throw new Error('Expected a diagnostic erorr message');
|
||||
} else {
|
||||
const matches: (d: Diagnostic) => boolean =
|
||||
typeof message === 'string' ? d => d.message == message : d => message.test(d.message);
|
||||
const matches: (d: Diagnostic) => boolean = typeof message === 'string' ?
|
||||
d => d.messageText == message :
|
||||
d => message.test(d.messageText);
|
||||
const matchingDiagnostics = diagnostics.filter(matches);
|
||||
if (!matchingDiagnostics || !matchingDiagnostics.length) {
|
||||
throw new Error(
|
||||
`Expected a diagnostics matching ${message}, received\n ${diagnostics.map(d => d.message).join('\n ')}`);
|
||||
`Expected a diagnostics matching ${message}, received\n ${diagnostics.map(d => d.messageText).join('\n ')}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -173,6 +174,6 @@ const LOWERING_QUICKSTART: MockDirectory = {
|
||||
|
||||
function expectNoDiagnostics(diagnostics: Diagnostic[]) {
|
||||
if (diagnostics && diagnostics.length) {
|
||||
throw new Error(diagnostics.map(d => `${d.span}: ${d.message}`).join('\n'));
|
||||
throw new Error(diagnostics.map(d => `${d.span}: ${d.messageText}`).join('\n'));
|
||||
}
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ export class DiagnosticContext {
|
||||
analyzeHost);
|
||||
|
||||
analyzedModules = this._analyzedModules =
|
||||
analyzeNgModules(programSymbols, analyzeHost, this.resolver);
|
||||
analyzeNgModules(programSymbols, analyzeHost, this.staticSymbolResolver, this.resolver);
|
||||
}
|
||||
return analyzedModules;
|
||||
}
|
||||
|
Reference in New Issue
Block a user