fix: move worker-loader to webpack config (#1405)
This avoids ESLint complaining about the `worker-loader!` declaration
This commit is contained in:
parent
009a511c80
commit
c98b96aa44
|
@ -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'
|
||||
|
|
|
@ -35,6 +35,12 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\/_workers\/blurhash\.js$/,
|
||||
use: {
|
||||
loader: 'worker-loader'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.m?js$/,
|
||||
include: /node_modules\/emoji-mart/,
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue