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..606316bc0c --- /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) 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,