Skip to content

Commit 12770c3

Browse files
authored
chore(css-modules): πŸ€– Prevent duplicate CSS imports in build watcher (#981)
* chore: πŸ€– prevent appending css duplication for watcher * chore: πŸ€– add changeset
1 parent a1b0891 commit 12770c3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clickhouse/click-ui': patch
3+
---
4+
5+
Prevent duplicate CSS imports in `vite build --watch` mode by clearing `trackedImports` between rebuilds

β€Žplugins/css-colocate/index.tsβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export const cssColocatePlugin = (): Plugin => {
2828
apply: 'build',
2929

3030
async buildStart() {
31+
// WARN: Reset between rebuilds
32+
// to prevent future build:watch transform to keep
33+
// appending, causing duplicate CSS imports
34+
// on each rebuild
35+
trackedImports.length = 0;
3136
await preprocessCssModules(config.root);
3237
},
3338

0 commit comments

Comments
Β (0)