File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,9 @@ export function assetsPlugin(pluginOpts?: FullstackPluginOptions): Plugin[] {
233233 if ( environment . name !== "client" ) {
234234 const collected = await collectCss ( environment , resolved . id ) ;
235235 for ( const file of [ resolved . id , ...collected . visitedFiles ] ) {
236- this . addWatchFile ( file ) ;
236+ if ( fs . existsSync ( file ) ) {
237+ this . addWatchFile ( file ) ;
238+ }
237239 }
238240 result . css = collected . hrefs . map ( ( href , i ) => ( {
239241 href,
@@ -398,7 +400,7 @@ async function collectCss(environment: DevEnvironment, entryId: string) {
398400 const visitedFiles = new Set < string > ( ) ;
399401
400402 async function recurse ( id : string ) {
401- if ( visited . has ( id ) ) {
403+ if ( visited . has ( id ) || parseAssetsVirtual ( id ) ) {
402404 return ;
403405 }
404406 visited . add ( id ) ;
@@ -407,7 +409,7 @@ async function collectCss(environment: DevEnvironment, entryId: string) {
407409 // TODO: this is not ideal.
408410 // We eagerly transforming module is required
409411 // to allow patterns like packages/fullstack/examples/react-router/src/routes.ts
410- if ( ! mod . transformResult && ! parseAssetsVirtual ( id ) ) {
412+ if ( ! mod . transformResult ) {
411413 try {
412414 await environment . transformRequest ( id ) ;
413415 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments