File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
examples/basic/src/routes/style-server Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -27,3 +27,7 @@ export function TestStyleServer() {
27
27
</ div >
28
28
)
29
29
}
30
+
31
+ // add no-op `import.meta.hot` to trigger `prune` event
32
+ // https://github.com/vitejs/vite/blob/84079a84ad94de4c1ef4f1bdb2ab448ff2c01196/packages/vite/src/node/plugins/importAnalysis.ts#L829-L840
33
+ import . meta. hot
Original file line number Diff line number Diff line change @@ -2030,6 +2030,17 @@ function vitePluginRscCss(
2030
2030
} ,
2031
2031
{
2032
2032
name : 'rsc:importer-resources' ,
2033
+ configureServer ( server ) {
2034
+ const hot = server . environments . rsc ! . hot
2035
+ const original = hot . send
2036
+ hot . send = function ( this , ...args : any [ ] ) {
2037
+ const e = args [ 0 ] as vite . PrunePayload
2038
+ if ( e && typeof e === 'object' && e . type === 'prune' ) {
2039
+ console . log ( '[rsc:prune]' , e )
2040
+ }
2041
+ return original . apply ( this , args as any )
2042
+ }
2043
+ } ,
2033
2044
async transform ( code , id ) {
2034
2045
if ( ! code . includes ( 'import.meta.viteRsc.loadCss' ) ) return
2035
2046
You can’t perform that action at this time.
0 commit comments