Unified · Split
| @@ -1,4 +1,5 @@ | ||
| 1 | 1 | import { readFile } from "node:fs/promises"; |
| 2 | +import { fileURLToPath } from "node:url"; | |
| 2 | 3 | |
| 3 | 4 | import initWasmExtractor, { |
| 4 | 5 | extract_manifest_json_wasm, |
| @@ -8,9 +9,11 @@ let initPromise: Promise<void> | undefined; · 3 unmodified lines | ||
| 8 | 9 | |
| 9 | 10 | const ensureWasmReady = (): Promise<void> => { |
| 10 | 11 | if (!initPromise) { |
| 11 | − initPromise = readFile( | |
| 12 | − new URL("./openapi-extractor-wasm/openapi_extractor_bg.wasm", import.meta.url), | |
| 13 | − ).then((wasmBytes) => | |
| 12 | + const wasmPath = fileURLToPath( | |
| 13 | + new URL("./openapi-extractor-wasm/openapi_extractor_bg.wasm", import.meta.url).toString(), | |
| 14 | + ); | |
| 15 | + | |
| 16 | + initPromise = readFile(wasmPath).then((wasmBytes) => | |
| 14 | 17 | initWasmExtractor({ module_or_path: wasmBytes }).then(() => undefined) |
| 15 | 18 | ); |
| 16 | 19 | } |