File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
packages/plugin-rsc/examples/browser-mode Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default defineConfig({
2121 } ) ,
2222 vitePluginDefineEncryptionKey ( ) ,
2323 {
24- name : 'rsc:run-in- browser' ,
24+ name : 'rsc:browser-mode ' ,
2525 configureServer ( server ) {
2626 server . middlewares . use ( async ( req , res , next ) => {
2727 const url = new URL ( req . url ?? '/' , 'https://any.local' )
@@ -37,10 +37,16 @@ export default defineConfig({
3737 next ( )
3838 } )
3939 } ,
40- // hotUpdate(ctx) {
41- // // TODO find out how to do HMR
42- // ctx.server.ws.send({ type: "full-reload", path: ctx.file });
43- // },
40+ hotUpdate ( ctx ) {
41+ if ( this . environment . name === 'react_client' ) {
42+ if ( ctx . modules . length > 0 ) {
43+ ctx . server . environments . client . hot . send ( {
44+ type : 'full-reload' ,
45+ path : ctx . file ,
46+ } )
47+ }
48+ }
49+ } ,
4450 config ( ) {
4551 return {
4652 environments : {
You can’t perform that action at this time.
0 commit comments