fix: disable hmr (#392)
Fixes disable HMR load hook filter in the react-server:runtime Vite
plugin.
b7d51adc3071Fixes disable HMR load hook filter in the react-server:runtime Vite
plugin.
packages/react-server/lib/plugins/react-server-runtime.mjs+5 -2| 43 | 43 | }, | |
| 44 | 44 | load: { | |
| 45 | 45 | filter: { | |
| 46 | - | id: /\/@hmr|\/@module-loader/, | |
| 46 | + | id: /\/@hmr|\/@__disable_hmr__|\/@module-loader/, | |
| 47 | 47 | }, | |
| 48 | 48 | handler(id) { | |
| 49 | 49 | if (id.endsWith("/@hmr")) { |
| 117 | 117 | } | |
| 118 | 118 | return moduleCache.get(id); | |
| 119 | 119 | }`; | |
| 120 | - | } else if (id.endsWith("@__disable_hmr__")) { | |
| 120 | + | } else if ( | |
| 121 | + | id === "/@__disable_hmr__" || | |
| 122 | + | id.endsWith("/@__disable_hmr__") | |
| 123 | + | ) { | |
| 121 | 124 | return `(function () { | |
| 122 | 125 | if (typeof WebSocket === 'undefined') return; | |
| 123 | 126 | const Orig = WebSocket; |