*Can't use dynamic import with esbuild

This commit is contained in:
Derrick Hammer 2023-01-31 07:48:47 -05:00
parent c5d761b3ae
commit 2cf5d6efb0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 4 deletions

View File

@ -93,15 +93,16 @@ export async function load(
} as ModuleBag;
}
const pkgName =
const pkg =
typeof window !== "undefined" && window?.document
? "libkernel"
: "libkmodule";
? await import("libkernel")
: await import("libkmodule");
const pkg = await import(pkgName);
callModule = pkg.callModule;
connectModule = pkg.connectModule;
// @ts-ignore
log = pkg.log;
// @ts-ignore
logErr = pkg.logErr;
return load(module);