fix(vite): client hmr (#3246)
This commit is contained in:
@@ -64,8 +64,8 @@ export function devServer(): Plugin[] {
|
|||||||
const clientMod = options.server.environments.client.moduleGraph
|
const clientMod = options.server.environments.client.moduleGraph
|
||||||
.getModulesByFile(options.file);
|
.getModulesByFile(options.file);
|
||||||
|
|
||||||
if (clientMod === undefined) {
|
if (clientMod !== undefined) {
|
||||||
options.server.hot.send("fresh:reload");
|
// Vite can do HMR here
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,9 +73,7 @@ export function devServer(): Plugin[] {
|
|||||||
.getModulesByFile(options.file);
|
.getModulesByFile(options.file);
|
||||||
if (ssrMod !== undefined) {
|
if (ssrMod !== undefined) {
|
||||||
// SSR-only module. Might still be a route.
|
// SSR-only module. Might still be a route.
|
||||||
// deno-lint-ignore no-console
|
// TODO: Implement proper ssr hmr
|
||||||
console.log("hmr", options.file);
|
|
||||||
|
|
||||||
options.server.hot.send("fresh:reload");
|
options.server.hot.send("fresh:reload");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user