mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 07:30:02 -04:00
fix: fix importfn and remove ts snip
This commit is contained in:
parent
f71e9c1ee0
commit
6b43c90831
2 changed files with 3 additions and 8 deletions
|
@ -5,14 +5,10 @@ import { rewriteUrl } from "../../shared/rewriters/url";
|
|||
export default function (client: ScramjetClient, self: Self) {
|
||||
const Function = client.natives.store["Function"];
|
||||
|
||||
self[config.globals.importfn] = function (base: string) {
|
||||
return function (url: string) {
|
||||
const resolved = new URL(url, base).href;
|
||||
self[config.globals.importfn] = function (base: string, url: string) {
|
||||
const resolved = new URL(url, base).href;
|
||||
|
||||
return Function(
|
||||
`return import("${rewriteUrl(resolved, client.meta)}")`
|
||||
)();
|
||||
};
|
||||
return Function(`return import("${rewriteUrl(resolved, client.meta)}")`)();
|
||||
};
|
||||
|
||||
self[config.globals.metafn] = function (base: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue