diff --git a/package-lock.json b/package-lock.json index 5417e3c..b4acc22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "tiny-async-pool": "^2.1.0", "tiny-glob": "^0.2.9", "wasm-vips": "^0.0.4", - "workbox-build": "^6.5.0", + "workbox-build": "^6.5.4", "yargs": "^17.6.2" }, "bin": { @@ -43,7 +43,7 @@ "eslint": "^8.32.0", "eslint-plugin-jsdoc": "^39.6.8", "eslint-plugin-promise": "^6.1.1", - "workbox-window": "^6.5.0" + "workbox-window": "^6.5.4" }, "engines": { "node": ">=14.13" diff --git a/src/minify.js b/src/minify.js index f334c7d..f7a21a5 100644 --- a/src/minify.js +++ b/src/minify.js @@ -351,15 +351,14 @@ async function minify(type){ ), ); - await asyncPool( + for await (const result of asyncPool( concurrentThreads, itemProcessingQueue, - async item => { - await processItem(item); - completedItemProcesses++; - bar(completedItemProcesses / itemProcessingQueue.length); - }, - ); + processItem, + )){ + completedItemProcesses++; + bar(completedItemProcesses / itemProcessingQueue.length); + } if(type === "images") vips.shutdown();