Skip to content

Commit cf1d104

Browse files
committed
fix: tweak
1 parent aa60efd commit cf1d104

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/plugin-rsc/src/plugin.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,12 @@ export default function vitePluginRsc(
479479
},
480480
async hotUpdate(ctx) {
481481
if (isCSSRequest(ctx.file)) {
482-
// keep default behavior for css with `?url` query, which uses `?direct` for HMR
483-
if (ctx.modules.find((m) => m.id && urlRE.test(m.id))) {
484-
return
485-
}
486482
if (this.environment.name === 'client') {
487483
// filter out `.css?direct` (injected by SSR) to avoid browser full reload
488484
// when changing non-self accepting css such as `module.css`.
489-
return ctx.modules.filter((m) => !m.id?.includes('?direct'))
485+
return ctx.modules.filter(
486+
(m) => !(m.id?.includes('?direct') && !m.isSelfAccepting),
487+
)
490488
}
491489
}
492490

0 commit comments

Comments
 (0)