Skip to content

Commit

Permalink
Scripts: fileURLToPath
Browse files Browse the repository at this point in the history
  • Loading branch information
slevithan committed Nov 10, 2024
1 parent 039cc3a commit 81d68d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {toRegExp} from '../dist/index.mjs';
import {r} from '../src/utils.js';
import {readFileSync} from 'node:fs';
import {fileURLToPath} from 'node:url';
// vscode-oniguruma 2.0.1 uses Oniguruma 6.9.8
import oniguruma from 'vscode-oniguruma';

Expand Down Expand Up @@ -120,7 +121,7 @@ async function onigurumaExec(pattern, str, pos = 0) {
}

async function loadOniguruma() {
const wasmPath = `${import.meta.dirname}/../node_modules/vscode-oniguruma/release/onig.wasm`;
const wasmPath = fileURLToPath(new URL('../node_modules/vscode-oniguruma/release/onig.wasm', import.meta.url));
const wasmBin = readFileSync(wasmPath).buffer;
await oniguruma.loadWASM(wasmBin);
}
Expand Down

0 comments on commit 81d68d6

Please sign in to comment.