File tree 1 file changed +15
-0
lines changed
packages/vite/src/node/server 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { RollupError } from 'rollup'
10
10
import { prepareError } from './middlewares/error'
11
11
import match from 'minimatch'
12
12
import { Server } from 'http'
13
+ import { isCSSRequest } from '../plugins/css'
13
14
14
15
export const debugHmr = createDebugger ( 'vite:hmr' )
15
16
@@ -222,6 +223,20 @@ function propagateUpdate(
222
223
boundary : node ,
223
224
acceptedVia : node
224
225
} )
226
+
227
+ // additionally check for CSS importers, since a PostCSS plugin like
228
+ // Tailwind JIT may register any file as a dependency to a CSS file.
229
+ for ( const importer of node . importers ) {
230
+ if ( isCSSRequest ( importer . url ) ) {
231
+ propagateUpdate (
232
+ importer ,
233
+ timestamp ,
234
+ boundaries ,
235
+ currentChain . concat ( importer )
236
+ )
237
+ }
238
+ }
239
+
225
240
return false
226
241
}
227
242
You can’t perform that action at this time.
0 commit comments