From 16176801b4438e0060c562fd1ad40fc4f28c574e Mon Sep 17 00:00:00 2001 From: Eugene Olonov Date: Thu, 29 Oct 2026 16:07:02 -0700 Subject: [PATCH 1/3] Hash CSS module class names relative to the repository root Without projectRoot, Lightning CSS hashes the absolute file path, so class names differ between machines and checkouts. Relative to the repository root, they are reproducible and stay distinct for modules at the same path in different packages. --- esbuildPlugins.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esbuildPlugins.mjs b/esbuildPlugins.mjs index 8a624828ba..5bd2aac4d1 100644 --- a/esbuildPlugins.mjs +++ b/esbuildPlugins.mjs @@ -1,3 +1,4 @@ +import { fileURLToPath } from 'url'; import lightningCssPlugin from 'unplugin-lightningcss/esbuild'; // Due to a bug in unplugin, we cannot use the Lightning CSS unplugin directly. @@ -18,7 +19,10 @@ const cssPlugin = { animation: false, grid: false, customIdents: false - } + }, + // Hashed class names come from the file path relative to this folder (the repository root): + // the same on every machine, and different for modules at the same path in different packages. + projectRoot: fileURLToPath(new URL('.', import.meta.url)) } }).setup({ ...build, From 068c0dcb74358c44ac3642e6d5e5a54f22e0f798 Mon Sep 17 00:00:00 2001 From: Eugene Olonov Date: Thu, 29 Oct 2026 19:48:27 -0700 Subject: [PATCH 2/3] Add the changelog fragment --- .changelog/5985-fix-css-module-hash-project-root.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/5985-fix-css-module-hash-project-root.md diff --git a/.changelog/5985-fix-css-module-hash-project-root.md b/.changelog/5985-fix-css-module-hash-project-root.md new file mode 100644 index 0000000000..a1a6e6a4b8 --- /dev/null +++ b/.changelog/5985-fix-css-module-hash-project-root.md @@ -0,0 +1,3 @@ +### Changed + +- hashed CSS class names no longer depend on the build machine's checkout path, in PR [#5985](https://github.com/microsoft/BotFramework-WebChat/pull/5985), by [@OEvgeny](https://github.com/OEvgeny) From 80a395dcdcdfac69c6bab379cf4a297fc3390f61 Mon Sep 17 00:00:00 2001 From: Eugene Olonov Date: Thu, 29 Oct 2026 19:48:46 -0700 Subject: [PATCH 3/3] Capitalize the changelog entry --- .changelog/5985-fix-css-module-hash-project-root.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/5985-fix-css-module-hash-project-root.md b/.changelog/5985-fix-css-module-hash-project-root.md index a1a6e6a4b8..606316bc0c 100644 --- a/.changelog/5985-fix-css-module-hash-project-root.md +++ b/.changelog/5985-fix-css-module-hash-project-root.md @@ -1,3 +1,3 @@ ### Changed -- hashed CSS class names no longer depend on the build machine's checkout path, in PR [#5985](https://github.com/microsoft/BotFramework-WebChat/pull/5985), by [@OEvgeny](https://github.com/OEvgeny) +- Hashed CSS class names no longer depend on the build machine's checkout path, in PR [#5985](https://github.com/microsoft/BotFramework-WebChat/pull/5985), by [@OEvgeny](https://github.com/OEvgeny)