Skip to content

Commit 13bda33

Browse files
authored
fix: track deps for css @import in build watch mode, fix #3387 (#3478)
1 parent 65d333d commit 13bda33

File tree

1 file changed

+7
-0
lines changed
  • packages/vite/src/node/plugins

1 file changed

+7
-0
lines changed

packages/vite/src/node/plugins/css.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ export function cssPlugin(config: ResolvedConfig): Plugin {
175175
moduleCache.set(id, modules)
176176
}
177177

178+
// track deps for build watch mode
179+
if (config.command === 'build' && config.build.watch && deps) {
180+
for (const file of deps) {
181+
this.addWatchFile(file)
182+
}
183+
}
184+
178185
// dev
179186
if (server) {
180187
// server only logic for handling CSS @import dependency hmr

0 commit comments

Comments
 (0)