From 97903270c39788b3d05b7f7d0700ccdf32503a9e Mon Sep 17 00:00:00 2001 From: Arianrhod Sandlot Date: Sun, 8 Oct 2023 16:33:36 +0800 Subject: [PATCH] fix: fix core loading --- src/emulator.ts | 6 +++--- src/nostalgist.ts | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/emulator.ts b/src/emulator.ts index 8604518..f7c3a4c 100644 --- a/src/emulator.ts +++ b/src/emulator.ts @@ -205,13 +205,13 @@ export class Emulator { if (!jsBlobUrl) { return } - const { getEmscripten } = await (() => { + const { getEmscripten } = await (async () => { try { - return import(/* @vite-ignore */ /* webpackIgnore: true */ jsBlobUrl) + return await import(/* @vite-ignore */ /* webpackIgnore: true */ jsBlobUrl) } catch { // a dirty hack for using with SystemJS, for example, in StackBlitz // eslint-disable-next-line no-eval - return eval('import(jsBlobUrl)') + return await eval('import(jsBlobUrl)') } })() URL.revokeObjectURL(jsBlobUrl) diff --git a/src/nostalgist.ts b/src/nostalgist.ts index efb7ef0..6ac1526 100644 --- a/src/nostalgist.ts +++ b/src/nostalgist.ts @@ -39,6 +39,8 @@ function baseName(url: string) { } export class Nostalgist { + static Nostalgist: Nostalgist + private static globalOptions = getDefaultOptions() private options: NostalgistOptions