File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ if (EXTERNAL_PATH) {
37
37
let lazy;
38
38
async function init () {
39
39
if (!lazy) {
40
- lazy = await import(require('node:url').pathToFileURL(require('node:module').createRequire('${ path . join ( EXTERNAL_PATH , ' dist/lexer.js' ) } ').resolve('./lexer.mjs')));
40
+ lazy = await import(require('node:url').pathToFileURL(require('node:module').createRequire('${ EXTERNAL_PATH } / dist/lexer.js').resolve('./lexer.mjs')));
41
41
}
42
42
module.exports = lazy;
43
43
return lazy.init();
Original file line number Diff line number Diff line change @@ -91,7 +91,12 @@ function copyLE (src, outBuf16) {
91
91
}
92
92
93
93
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
+ ) ;
95
100
} ) ) || ( async ( ) => {
96
101
const binary = WASM_BINARY
97
102
if ( typeof window !== "undefined" && typeof atob === "function" ) {
You can’t perform that action at this time.
0 commit comments