From 92f52319dae6539307fd071d27c1d8fa8b9d9212 Mon Sep 17 00:00:00 2001 From: Jimmy Cao Date: Mon, 30 Aug 2021 13:37:17 -0700 Subject: [PATCH] Use pathify to calculate absolute paths for cross-platform compatibility --- libsquoosh/src/emscripten-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsquoosh/src/emscripten-utils.ts b/libsquoosh/src/emscripten-utils.ts index a6481508..c43029f1 100644 --- a/libsquoosh/src/emscripten-utils.ts +++ b/libsquoosh/src/emscripten-utils.ts @@ -19,7 +19,7 @@ export function instantiateEmscriptenWasm( // These will have changed in the bundling process and // we need to inject them here. if (requestPath.endsWith('.wasm')) return pathify(path); - if (requestPath.endsWith('.worker.js')) return new URL(workerJS).pathname; + if (requestPath.endsWith('.worker.js')) return pathify(workerJS); return requestPath; }, });