File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,10 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
175
175
// raw requests, read from disk
176
176
if ( rawRE . test ( id ) ) {
177
177
const file = checkPublicFile ( id , config ) || cleanUrl ( id )
178
- // this.addWatchFile(file)
178
+ if ( config . command !== 'build' ) {
179
+ // @ts -expect-error
180
+ this . addWatchFile ( file )
181
+ }
179
182
// raw query, read file and return as string
180
183
return `export default ${ JSON . stringify (
181
184
await fsp . readFile ( file , 'utf-8' ) ,
Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ export function cssPlugin(config: ResolvedConfig): Plugin {
367
367
const {
368
368
code : css ,
369
369
modules,
370
- // deps,
370
+ deps,
371
371
map,
372
372
} = await compileCSS (
373
373
id ,
@@ -380,11 +380,12 @@ export function cssPlugin(config: ResolvedConfig): Plugin {
380
380
moduleCache . set ( id , modules )
381
381
}
382
382
383
- // if (deps) {
384
- // for (const file of deps) {
385
- // this.addWatchFile(file)
386
- // }
387
- // }
383
+ if ( deps && ! isBuild ) {
384
+ for ( const file of deps ) {
385
+ // @ts -expect-error
386
+ this . addWatchFile ( file )
387
+ }
388
+ }
388
389
389
390
return {
390
391
code : css ,
You can’t perform that action at this time.
0 commit comments