fix: HMR in development

This commit is contained in:
Tom Moor
2023-02-20 11:23:25 -05:00
parent 0e622288ff
commit a9e373c72f
3 changed files with 63 additions and 67 deletions

View File

@@ -73,14 +73,14 @@ export const renderApp = async (
readManifestFile()[entry]["file"]
}"></script>`
: `<script type="module">
import RefreshRuntime from 'http://localhost:3001/@react-refresh'
import RefreshRuntime from 'http://localhost:3001/static/@react-refresh'
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => { }
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
</script>
<script type="module" src="http://localhost:3001/@vite/client"></script>
<script type="module" src="http://localhost:3001/${entry}"></script>
<script type="module" src="http://localhost:3001/static/@vite/client"></script>
<script type="module" src="http://localhost:3001/static/${entry}"></script>
`;
ctx.body = page