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() {
2727 </ div >
2828 )
2929}
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(
20302030 } ,
20312031 {
20322032 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+ } ,
20332044 async transform ( code , id ) {
20342045 if ( ! code . includes ( 'import.meta.viteRsc.loadCss' ) ) return
20352046
You can’t perform that action at this time.
0 commit comments