diff --git a/src/libarchive-node.ts b/src/libarchive-node.ts index 5b5e092..a3a5cb9 100644 --- a/src/libarchive-node.ts +++ b/src/libarchive-node.ts @@ -1,11 +1,12 @@ import { Worker } from "worker_threads"; -import { URL } from "url"; +import { dirname } from "path"; +import { fileURLToPath } from "url"; import * as Comlink from "comlink"; import nodeEndpoint from "comlink/dist/esm/node-adapter"; import { Archive } from "./libarchive"; export * from "./libarchive"; -const __dirname = new URL(".", import.meta.url).pathname; +const __dirname = dirname(fileURLToPath(import.meta.url)); Archive.init({ getWorker: () => new Worker(`${__dirname}/worker-bundle-node.mjs`),