File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,6 +140,20 @@ export default defineNuxtConfig({
140140hmr : {
141141clientPort : process . env . PORT ? + process . env . PORT : undefined ,
142142} ,
143+ // Local standalone dev only (`pnpm dev` -> `nuxi dev client`): this app
144+ // dogfoods the DevTools module on itself, so the Vite DevTools hub serves
145+ // the devframe connection meta at `/__devtools/__connection.json`. But the
146+ // client SPA (RPC client) resolves `__connection.json` relative to its
147+ // current route (e.g. `/__nuxt_devtools__/client/modules/__connection.json`),
148+ // which the hub never serves. Proxy those relative lookups back to the hub
149+ // so the standalone client can connect to a live RPC backend.
150+ proxy : {
151+ '^/__nuxt_devtools__/client/.*__connection\\.json(\\?.*)?$' : {
152+ target : `http://localhost:${ process . env . PORT || 3000 } ` ,
153+ changeOrigin : true ,
154+ rewrite : ( ) => '/__devtools/__connection.json' ,
155+ } ,
156+ } ,
143157} ,
144158} ,
145159
You can’t perform that action at this time.
0 commit comments