Skip to content

Commit 87425a7

Browse files
clydinalan-agius4
authored andcommitted
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. (cherry picked from commit ca44261)
1 parent 7e7ea75 commit 87425a7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/angular/component-stylesheets.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,13 @@ export class ComponentStylesheetBundler {
111111
return;
112112
}
113113

114+
const normalizedFiles = [...files].map(path.normalize);
115+
114116
for (const bundler of this.#fileContexts.values()) {
115-
bundler.invalidate(files);
117+
bundler.invalidate(normalizedFiles);
116118
}
117119
for (const bundler of this.#inlineContexts.values()) {
118-
bundler.invalidate(files);
120+
bundler.invalidate(normalizedFiles);
119121
}
120122
}
121123

tests/legacy-cli/e2e/tests/basic/rebuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default async function () {
116116
const response = await fetch(`http://localhost:${port}/styles.css`);
117117
const body = await response.text();
118118
if (!body.match(/color:\s?green/)) {
119-
throw new Error('Expected component CSS to update.');
119+
throw new Error('Expected global CSS to update.');
120120
}
121121
}
122122
}

0 commit comments

Comments
 (0)