Skip to content

Commit

Permalink
fix: fix legacy script patching
Browse files Browse the repository at this point in the history
  • Loading branch information
arianrhodsandlot committed Jan 28, 2025
1 parent 74c9834 commit 3f106d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function patchCoreJs({ js, name }: { js: ResolvableFile; name: string }) {

if (isGlobalScript(jsContent)) {
jsContent = `export function getEmscripten({ Module }) {
${js};
${jsContent};
Module.FS = FS;
Module.PATH = PATH;
Module.ERRNO_CODES = ERRNO_CODES;
Expand Down Expand Up @@ -109,7 +109,7 @@ export async function importCoreJsAsESM({ js, name }: { js: ResolvableFile; name
return await import(/* @vite-ignore */ /* webpackIgnore: true */ jsObjectUrl)
} catch {
// a dirty hack for using with SystemJS, for example, in StackBlitz
return await new Function('return import(jsObjectUrl)')()
return await new Function(`return import('${jsObjectUrl}')`)()
} finally {
jsResolvable.dispose()
}
Expand Down

0 comments on commit 3f106d9

Please sign in to comment.