Rename global variables
This commit is contained in:
Vendored
+5
-5
@@ -1,7 +1,7 @@
|
||||
function removeController(controller) {
|
||||
const idx = global.HMR_CONTROLLERS.findIndex((c) => c.controller == controller);
|
||||
const idx = global.BUNEXT_HMR_CONTROLLERS.findIndex((c) => c.controller == controller);
|
||||
if (typeof idx == "number" && idx >= 0) {
|
||||
global.HMR_CONTROLLERS.splice(idx, 1);
|
||||
global.BUNEXT_HMR_CONTROLLERS.splice(idx, 1);
|
||||
}
|
||||
}
|
||||
export default async function ({ req }) {
|
||||
@@ -17,16 +17,16 @@ export default async function ({ req }) {
|
||||
catch {
|
||||
return new Response("Invalid Referer Header", { status: 400 });
|
||||
}
|
||||
const match = global.ROUTER.match(referer_url.pathname);
|
||||
const match = global.BUNEXT_ROUTER.match(referer_url.pathname);
|
||||
const target_map = match?.filePath
|
||||
? global.BUNDLER_CTX_MAP?.[match.filePath]
|
||||
? global.BUNEXT_BUNDLER_CTX_MAP?.[match.filePath]
|
||||
: undefined;
|
||||
let controller;
|
||||
let heartbeat;
|
||||
const stream = new ReadableStream({
|
||||
start(c) {
|
||||
controller = c;
|
||||
global.HMR_CONTROLLERS.push({
|
||||
global.BUNEXT_HMR_CONTROLLERS.push({
|
||||
controller: c,
|
||||
page_url: referer_url.href,
|
||||
target_map,
|
||||
|
||||
Reference in New Issue
Block a user