Skip to content

Commit

Permalink
fix: track deps for css @import in build watch mode, fix #3387 (#3478)
Browse files Browse the repository at this point in the history
  • Loading branch information
CHOYSEN authored May 24, 2021
1 parent 65d333d commit 13bda33
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ export function cssPlugin(config: ResolvedConfig): Plugin {
moduleCache.set(id, modules)
}

// track deps for build watch mode
if (config.command === 'build' && config.build.watch && deps) {
for (const file of deps) {
this.addWatchFile(file)
}
}

// dev
if (server) {
// server only logic for handling CSS @import dependency hmr
Expand Down

0 comments on commit 13bda33

Please sign in to comment.