mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
Migrate internal bundles to System (#4233)
This commit is contained in:
parent
70fe1f9fd3
commit
30682cf74f
9 changed files with 142 additions and 216 deletions
|
@ -50,8 +50,8 @@ export function buildBundle(
|
|||
let instantiate: string;
|
||||
if (rootExports && rootExports.length) {
|
||||
instantiate = hasTla
|
||||
? `const __exp = await __inst("${rootName}");\n`
|
||||
: `const __exp = __inst_s("${rootName}");\n`;
|
||||
? `const __exp = await __instantiateAsync("${rootName}");\n`
|
||||
: `const __exp = __instantiate("${rootName}");\n`;
|
||||
for (const rootExport of rootExports) {
|
||||
if (rootExport === "default") {
|
||||
instantiate += `export default __exp["${rootExport}"];\n`;
|
||||
|
@ -61,8 +61,8 @@ export function buildBundle(
|
|||
}
|
||||
} else {
|
||||
instantiate = hasTla
|
||||
? `await __inst("${rootName}");\n`
|
||||
: `__inst_s("${rootName}");\n`;
|
||||
? `await __instantiateAsync("${rootName}");\n`
|
||||
: `__instantiate("${rootName}");\n`;
|
||||
}
|
||||
return `${SYSTEM_LOADER}\n${data}\n${instantiate}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue