From c47cf3a0f44bdd3b480ddef2438b86b4daddb6f3 Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Thu, 12 Oct 2023 17:02:05 -0700 Subject: [PATCH] Remove redundant jimp fetches (#6333) --- packages/web/craco.config.ts | 5 +++++ packages/web/public/index.html | 4 ---- packages/web/src/services/WebWorker.js | 9 +++++---- packages/web/src/utils/imageProcessingUtil.ts | 15 ++++++++++----- packages/web/src/workers/averageRgb.worker.js | 8 ++------ packages/web/src/workers/dominantColor.worker.js | 4 ---- .../src/workers/generatePlaylistArtwork.worker.js | 4 ---- packages/web/src/workers/gifPreview.worker.js | 4 ---- packages/web/src/workers/resizeImage.worker.js | 3 --- .../web/src/workers/utils/jimp.min.workerscript | 1 + 10 files changed, 23 insertions(+), 34 deletions(-) create mode 100644 packages/web/src/workers/utils/jimp.min.workerscript diff --git a/packages/web/craco.config.ts b/packages/web/craco.config.ts index 230f647ddea..12e9523e842 100644 --- a/packages/web/craco.config.ts +++ b/packages/web/craco.config.ts @@ -70,6 +70,11 @@ export default { test: /\.wasm$/, type: 'webassembly/async' }, + { + test: /\.workerscript$/, + use: ['raw-loader'], + type: 'javascript/auto' + }, { test: /\.(glsl|vs|fs|vert|frag)$/, exclude: /node_modules/, diff --git a/packages/web/public/index.html b/packages/web/public/index.html index 583d491aa2c..f8bdcb7a205 100644 --- a/packages/web/public/index.html +++ b/packages/web/public/index.html @@ -34,10 +34,6 @@ onLoad="window.web3Loaded = true; window.dispatchEvent(new CustomEvent('WEB3_LOADED'))" src="%PUBLIC_URL%/scripts/web3.min.js" > -