File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ if (EXTERNAL_PATH) {
3737let lazy;
3838async function init () {
3939 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')));
4141 }
4242 module.exports = lazy;
4343 return lazy.init();
Original file line number Diff line number Diff line change @@ -91,7 +91,12 @@ function copyLE (src, outBuf16) {
9191}
9292
9393const 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" ) {
You can’t perform that action at this time.
0 commit comments