Set workerPublicPath in webpack config (#20629)

GitOrigin-RevId: 3fba33a6b52bf2a91f3126efc9d76f6f1dfbc1c4
This commit is contained in:
Alf Eaton
2024-10-14 11:06:45 +00:00
committed by Copybot
parent d9a4c5b2bc
commit 53d6b4dfd0
6 changed files with 19 additions and 31 deletions
@@ -1,5 +1,4 @@
import { v4 as uuid } from 'uuid'
import { createWorker } from '@/utils/worker'
import getMeta from '@/utils/meta'
import { debugConsole } from '@/utils/debugging'
@@ -50,14 +49,13 @@ export class HunspellManager {
this.dictionariesRoot = getMeta('ol-dictionariesRoot')
createWorker(() => {
this.hunspellWorker = new Worker(
new URL('./hunspell.worker.ts', import.meta.url),
{ type: 'module' }
)
this.hunspellWorker = new Worker(
/* webpackChunkName: "hunspell-worker" */
new URL('./hunspell.worker.ts', import.meta.url),
{ type: 'module' }
)
this.hunspellWorker.addEventListener('message', this.receive.bind(this))
})
this.hunspellWorker.addEventListener('message', this.receive.bind(this))
}
destroy() {
@@ -1,16 +1,13 @@
import { createWorker } from '../../../../../utils/worker'
import { EditorView } from '@codemirror/view'
import { Diagnostic } from '@codemirror/lint'
import { errorsToDiagnostics, LintError } from './errors-to-diagnostics'
import { mergeCompatibleOverlappingDiagnostics } from './merge-overlapping-diagnostics'
let lintWorker: Worker
createWorker(() => {
lintWorker = new Worker(
new URL('./latex-linter.worker.js', import.meta.url),
{ type: 'module' }
)
})
const lintWorker = new Worker(
/* webpackChunkName: "latex-linter-worker" */
new URL('./latex-linter.worker.js', import.meta.url),
{ type: 'module' }
)
class Deferred {
public promise: Promise<readonly Diagnostic[]>