diff --git a/src/routes/_utils/blurhash.js b/src/routes/_utils/blurhash.js index 9534c72d..12296765 100644 --- a/src/routes/_utils/blurhash.js +++ b/src/routes/_utils/blurhash.js @@ -1,4 +1,4 @@ -import BlurhashWorker from 'worker-loader!../_workers/blurhash' // eslint-disable-line +import BlurhashWorker from '../_workers/blurhash' import PromiseWorker from 'promise-worker' import { BLURHASH_RESOLUTION as RESOLUTION } from '../_static/blurhash' import { QuickLRU } from '../_thirdparty/quick-lru/quick-lru' diff --git a/webpack/client.config.js b/webpack/client.config.js index da57207c..1dc3709a 100644 --- a/webpack/client.config.js +++ b/webpack/client.config.js @@ -35,6 +35,12 @@ module.exports = { } } }, + { + test: /\/_workers\/blurhash\.js$/, + use: { + loader: 'worker-loader' + } + }, { test: /\.m?js$/, include: /node_modules\/emoji-mart/, diff --git a/webpack/server.config.js b/webpack/server.config.js index 7a529d78..31da5942 100644 --- a/webpack/server.config.js +++ b/webpack/server.config.js @@ -5,6 +5,7 @@ const { mode, dev, resolve, inlineSvgs } = require('./shared.config') const serverResolve = JSON.parse(JSON.stringify(resolve)) serverResolve.alias['page-lifecycle/dist/lifecycle.mjs'] = 'lodash-es/noop' // page lifecycle fails in Node +serverResolve.alias['../_workers/blurhash'] = 'lodash-es/noop' // not used on the server side module.exports = { entry: config.server.entry(),