Migrate internal bundles to System (#4233)

This commit is contained in:
Kitson Kelly 2020-03-05 00:26:00 +11:00 committed by GitHub
parent 70fe1f9fd3
commit 30682cf74f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 142 additions and 216 deletions

View file

@ -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}`;
}