fix: prevent rollup from optimizing "void 0" to "undefined"

This commit is contained in:
TopchetoEU 2025-01-09 00:13:14 +02:00
parent 98dde69751
commit 9076c5fc1b
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -112,7 +112,8 @@ export interface Primordials {
schedule(func: () => void, delay: number): () => void;
}
globalThis.undefined = void 0;
// prevent optimization to "undefined", which doesn't exist yet
globalThis.undefined = ({} as any).bogus;
export const target = (globalThis as any).target;
export const primordials: Primordials = (globalThis as any).primordials;