Skip to content

Commit a65f6be

Browse files
committed
Move grainc location
1 parent c826fa1 commit a65f6be

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"prepare": "node scripts/generateContributors.js && node src/playground/cli.mjs",
88
"dev": "astro dev",
99
"start": "astro dev",
10-
"build": "NODE_OPTIONS=--max-old-space-size=8192 astro build",
10+
"build": "astro build",
1111
"preview": "astro preview",
1212
"astro": "astro"
1313
},
File renamed without changes.

src/playground/compiler.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import fs, { loadStdlib, stdlibRoot } from "./browser-fs/fs";
2-
import grainc from "./grain/grainc.bc.mjs";
32
import constants from "constants-browserify/constants.json";
43
import { Buffer } from "buffer";
54
import { init, WASI } from "@wasmer/wasi";
65
import { tailCall, bulkMemory } from "wasm-feature-detect";
6+
import graincUrl from "../../public/grainc.bc.mjs?url";
7+
8+
const graincPromise = import(graincUrl);
79

810
globalThis.Buffer = Buffer;
911

@@ -82,7 +84,8 @@ addEventListener("message", async ({ data }) => {
8284
fs.writeFileSync("/test.gr", data.content);
8385
fs.writeFileSync("/test.gr.wasm", "");
8486
try {
85-
grainc(globalThis);
87+
const grainc = await graincPromise;
88+
grainc.default(globalThis);
8689

8790
try {
8891
await init();

0 commit comments

Comments
 (0)