Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): normalize paths when invalidating…
Browse files Browse the repository at this point in the history
… 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.

(cherry picked from commit ca44261)
  • Loading branch information
clydin authored and alan-agius4 committed Oct 25, 2023
1 parent 7e7ea75 commit 87425a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/basic/rebuild.ts
Expand Up @@ -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.');
}
}
}

0 comments on commit 87425a7

Please sign in to comment.