/** --- WASI */ // wasi is imported into the top of this file const filePath = process.argv.at(1); if (!filePath) { var err = new Error("To run a wasm file with Bun, the first argument must be a path to a .wasm file"); err.name = "WasmFileNotFound"; throw err; } // The module specifier is the resolved path to the wasm file var { WASM_CWD = process.cwd(), WASM_ROOT_DIR = "/", WASM_ENV_STR = undefined, WASM_USE_ASYNC_INIT = "" } = process.env; var env = process.env; if (WASM_ENV_STR?.length) { env = JSON.parse(WASM_ENV_STR); } const wasi = new WASI({ args: process.argv.slice(1), env, preopens: { ".": WASM_CWD || process.cwd(), "/": WASM_ROOT_DIR || "/", }, }); let source = globalThis.wasmSourceBytes; if (!source) { const fs = Bun.fs(); const file = import.meta.path; source = fs.readFileSync(file); } const wasm = new WebAssembly.Module(source); const instance = !WASM_USE_ASYNC_INIT ? new WebAssembly.Instance(wasm, wasi.getImports(wasm)) : await WebAssembly.instantiate(wasm, wasi.getImports(wasm)); wasi.start(instance); process.exit(0); n> Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.debug.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2021-11-24deps: add missing mimalloc dep to jsc bindings header generatorGravatar Kenta Iwasaki 2-2/+3
2021-11-24deps: build picohttp and mimalloc using zigGravatar Kenta Iwasaki 2-131/+123
2021-11-23update Next version on globalGravatar Jack Hanford 1-1/+1
2021-11-23Update build-idGravatar Jarred Sumner 1-1/+1
2021-11-23fix shallow routingGravatar Jack Hanford 1-4/+6
2021-11-23remove commentGravatar Jack Hanford 1-1/+0
2021-11-23add react-dom as devDepGravatar Jack Hanford 1-0/+1
2021-11-23stop installing textencoderGravatar Jack Hanford 3-2/+308
2021-11-23begin addressing more feedbackGravatar Jack Hanford 1-3/+3
2021-11-22remove .thenGravatar Jack Hanford 1-12/+3
2021-11-22another tryGravatar Jack Hanford 2-5/+1
2021-11-22add type fnsGravatar Jack Hanford 1-1/+4