mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-19 20:52:06 +08:00
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:
parent
f7130ef639
commit
ca4426150f
@ -111,11 +111,13 @@ export class ComponentStylesheetBundler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const normalizedFiles = [...files].map(path.normalize);
|
||||||
|
|
||||||
for (const bundler of this.#fileContexts.values()) {
|
for (const bundler of this.#fileContexts.values()) {
|
||||||
bundler.invalidate(files);
|
bundler.invalidate(normalizedFiles);
|
||||||
}
|
}
|
||||||
for (const bundler of this.#inlineContexts.values()) {
|
for (const bundler of this.#inlineContexts.values()) {
|
||||||
bundler.invalidate(files);
|
bundler.invalidate(normalizedFiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ export default async function () {
|
|||||||
const response = await fetch(`http://localhost:${port}/styles.css`);
|
const response = await fetch(`http://localhost:${port}/styles.css`);
|
||||||
const body = await response.text();
|
const body = await response.text();
|
||||||
if (!body.match(/color:\s?green/)) {
|
if (!body.match(/color:\s?green/)) {
|
||||||
throw new Error('Expected component CSS to update.');
|
throw new Error('Expected global CSS to update.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user