File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { utimes } from 'fs/promises'
2
2
import * as path from 'upath'
3
3
import _debug from 'debug'
4
+ import { normalizePath } from 'vite'
4
5
import { cacheDir , writeStyles , resolveVuetifyBase } from '@vuetify/loader-shared'
5
6
6
7
import type { Plugin , ViteDevServer } from 'vite'
@@ -98,11 +99,13 @@ export function stylesPlugin (options: Options): Plugin {
98
99
await writeStyles ( files )
99
100
100
101
if ( server && needsTouch ) {
101
- server . moduleGraph . getModulesByFile ( cacheDir ( 'styles.scss' ) ) ?. forEach ( module => {
102
+ const cacheFile = normalizePath ( cacheDir ( 'styles.scss' ) )
103
+ server . moduleGraph . getModulesByFile ( cacheFile ) ?. forEach ( module => {
102
104
module . importers . forEach ( module => {
103
105
if ( module . file ) {
106
+ const now = new Date ( )
104
107
debug ( `touching ${ module . file } ` )
105
- utimes ( module . file , Date . now ( ) , Date . now ( ) )
108
+ utimes ( module . file , now , now )
106
109
}
107
110
} )
108
111
} )
You can’t perform that action at this time.
0 commit comments