Skip to content

Commit 6663bca

Browse files
committed
Revert "tests: fix loading wasm when targeting external deps (#94)"
This reverts commit bcc6ce4.
1 parent bcc6ce4 commit 6663bca

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if (EXTERNAL_PATH) {
3737
let lazy;
3838
async function init () {
3939
if (!lazy) {
40-
lazy = await import(require('node:url').pathToFileURL(require('node:module').createRequire('${EXTERNAL_PATH}/dist/lexer.js').resolve('./lexer.mjs')));
40+
lazy = await import(require('node:url').pathToFileURL(require('node:module').createRequire('${path.join(EXTERNAL_PATH, 'dist/lexer.js')}').resolve('./lexer.mjs')));
4141
}
4242
module.exports = lazy;
4343
return lazy.init();

src/lexer.js

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

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

0 commit comments

Comments
 (0)