Skip to content

Commit a54d930

Browse files
committed
tests: fix loading wasm when targeting external deps
1 parent 5f974d8 commit a54d930

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lexer.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ function copyLE (src, outBuf16) {
9191
}
9292

9393
const loadWasm = (typeof EXTERNAL_PATH === "string" && (async () => {
94-
return (await import('node:fs/promises')).readFile(EXTERNAL_PATH);
94+
return (await import("node:fs/promises"))
95+
.readFile(
96+
(await import("node:url")).fileURLToPath(
97+
import.meta.resolve("../lib/lexer.wasm")
98+
)
99+
);
95100
})) || (async () => {
96101
const binary = WASM_BINARY
97102
if (typeof window !== "undefined" && typeof atob === "function") {

0 commit comments

Comments
 (0)