Files
sweet/src/server/constants.ts
T
Luca CasonatoandAsher Gomez 87b087e358 fix: __FRSH_BUILD_ID is not defined (#1207)
This could happen if the runtime/utils.ts coe was loaded
prior to server/constants.ts, because they had some shared state on
`globalThis`.

I have mitigated this by not relying on global state anymore.

Fixes #1191

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-05-30 10:46:44 +10:00

12 lines
416 B
TypeScript

import { INTERNAL_PREFIX } from "../runtime/utils.ts";
import { BUILD_ID } from "./build_id.ts";
export const REFRESH_JS_URL = `${INTERNAL_PREFIX}/refresh.js`;
export const ALIVE_URL = `${INTERNAL_PREFIX}/alive`;
export const JS_PREFIX = `/js`;
export const DEBUG = !Deno.env.get("DENO_DEPLOYMENT_ID");
export function bundleAssetUrl(path: string) {
return `${INTERNAL_PREFIX}${JS_PREFIX}/${BUILD_ID}${path}`;
}