From 3744bdaafe698ec68684fe43d1cd893274c51a90 Mon Sep 17 00:00:00 2001 From: Avaer Kazmer Date: Mon, 4 Nov 2019 18:49:42 -0500 Subject: [PATCH] Bugfix z-worker base path --- zip.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zip.js b/zip.js index f7969c6..7bd14f3 100644 --- a/zip.js +++ b/zip.js @@ -26,6 +26,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +const basePath = import.meta.url.replace(/[^\/]*$/, ''); + (function(obj) { "use strict"; @@ -870,8 +872,8 @@ } var DEFAULT_WORKER_SCRIPTS = { - deflater: ['z-worker.js', 'deflate.js'], - inflater: ['z-worker.js', 'inflate.js'] + deflater: [basePath + 'z-worker.js', basePath + 'deflate.js'], + inflater: [basePath + 'z-worker.js', basePath + 'inflate.js'] }; function createWorker(type, callback, onerror) { if (obj.zip.workerScripts !== null && obj.zip.workerScriptsPath !== null) {