Sitelet https://github.com/angular/angular-cli/commit/978351af71889d4786a18fec9e193eb5b16af7dd
Skip to content

Commit 978351a

Browse files
committed
fix(@angular/build): include inline component stylesheets in referenced watch files
Collect referenced files from inline stylesheet contexts in addition to file contexts when gathering watch files, and catch unhandled rejections when disposing an inline bundler context.
1 parent a704f77 commit 978351a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎packages/angular/build/src/tools/esbuild/angular/component-stylesheets.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export class ComponentStylesheetBundler {
219219
const filename = secondSemi !== -1 ? entry.slice(secondSemi + 1) : '';
220220
if (filename && normalizedFiles.has(path.normalize(filename))) {
221221
this.#inlineContexts.delete(entry);
222-
void bundler.dispose();
222+
void bundler.dispose().catch(() => {});
223223
} else {
224224
bundler.invalidate(normalizedFiles);
225225
}
@@ -229,10 +229,13 @@ export class ComponentStylesheetBundler {
229229
}
230230

231231
collectReferencedFiles(): string[] {
232-
const files = [];
232+
const files: string[] = [];
233233
for (const context of this.#fileContexts.values()) {
234234
files.push(...context.watchFiles);
235235
}
236+
for (const context of this.#inlineContexts.values()) {
237+
files.push(...context.watchFiles);
238+
}
236239

237240
return files;
238241
}

0 commit comments

Comments
 (0)