Bugfix: update stale HMR after fixed errors
This commit is contained in:
@@ -20,9 +20,12 @@ export default async function grabPageBundledReactComponent({
|
||||
}: Params): Promise<GrabPageReactBundledComponentRes | undefined> {
|
||||
try {
|
||||
if (global.SSR_BUNDLER_CTX_MAP?.[file_path]) {
|
||||
const mod = await import(
|
||||
path.join(ROOT_DIR, global.SSR_BUNDLER_CTX_MAP[file_path].path)
|
||||
const abs = path.join(
|
||||
ROOT_DIR,
|
||||
global.SSR_BUNDLER_CTX_MAP[file_path].path,
|
||||
);
|
||||
Loader.registry.delete(abs);
|
||||
const mod = await import(`${abs}?t=${Date.now()}`);
|
||||
|
||||
const Main = mod.default as FC;
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ export default async function grabPageCombinedServerRes({
|
||||
? path.join(ROOT_DIR, root_server_ctx_map.path)
|
||||
: root_server_file_path;
|
||||
|
||||
if (final_root_server_path) {
|
||||
Loader.registry.delete(final_root_server_path);
|
||||
}
|
||||
const root_server_module: BunextPageServerModule = final_root_server_path
|
||||
? await import(`${final_root_server_path}?t=${now}`)
|
||||
: undefined;
|
||||
@@ -65,6 +68,9 @@ export default async function grabPageCombinedServerRes({
|
||||
? path.join(ROOT_DIR, page_server_ctx.path)
|
||||
: server_file_path;
|
||||
|
||||
if (final_page_server_path) {
|
||||
Loader.registry.delete(final_page_server_path);
|
||||
}
|
||||
const server_module: BunextPageServerModule = final_page_server_path
|
||||
? await import(`${final_page_server_path}?t=${now}`)
|
||||
: undefined;
|
||||
|
||||
Reference in New Issue
Block a user