fix(@angular-devkit/build-angular): normalize paths when invalidating stylesheet bundler

To avoid incorrectly invalidating the stylesheet bundler within the application builder
on Windows, the paths of changed files are now first normalized. This ensures that any
changed files properly cause affected component stylesheets to be reprocessed.
This commit is contained in:
Charles Lyding 2023-10-25 00:04:42 -04:00 committed by Alan Agius
parent f7130ef639
commit ca4426150f
2 changed files with 5 additions and 3 deletions

View File

@ -111,11 +111,13 @@ export class ComponentStylesheetBundler {
return;
}
const normalizedFiles = [...files].map(path.normalize);
for (const bundler of this.#fileContexts.values()) {
bundler.invalidate(files);
bundler.invalidate(normalizedFiles);
}
for (const bundler of this.#inlineContexts.values()) {
bundler.invalidate(files);
bundler.invalidate(normalizedFiles);
}
}

View File

@ -116,7 +116,7 @@ export default async function () {
const response = await fetch(`http://localhost:${port}/styles.css`);
const body = await response.text();
if (!body.match(/color:\s?green/)) {
throw new Error('Expected component CSS to update.');
throw new Error('Expected global CSS to update.');
}
}
}