Skip to content

Commit

Permalink
Merge pull request #104 from CodinGame/fix-worker-config
Browse files Browse the repository at this point in the history
Fix worker config
  • Loading branch information
CGNonofr authored Feb 25, 2024
2 parents d5493e4 + 650de43 commit c3592f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/features/viewPanels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { registerWorkerLoader } from '../worker'
import { Worker } from '../tools/crossOriginWorker'
import '@codingame/monaco-vscode-references-view-default-extension'

registerWorkerLoader('outputLinkComputer', () => new Worker(new URL('@codingame/monaco-vscode-output-service-override/worker', import.meta.url)))
registerWorkerLoader('outputLinkComputer', () => new Worker(new URL('@codingame/monaco-vscode-output-service-override/worker', import.meta.url), { type: 'module' }))

registerServices({
...getTimelineServiceOverride(),
Expand Down
6 changes: 3 additions & 3 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Worker } from './tools/crossOriginWorker'
export type WorkerLoader = () => Worker

const workerLoaders: Partial<Record<string, WorkerLoader>> = {
editorWorkerService: () => new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker', import.meta.url)),
textMateWorker: () => new Worker(new URL('@codingame/monaco-vscode-textmate-service-override/worker', import.meta.url)),
languageDetectionWorkerService: () => new Worker(new URL('@codingame/monaco-vscode-language-detection-worker-service-override/worker', import.meta.url))
editorWorkerService: () => new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url), { type: 'module' }),
textMateWorker: () => new Worker(new URL('@codingame/monaco-vscode-textmate-service-override/worker', import.meta.url), { type: 'module' }),
languageDetectionWorkerService: () => new Worker(new URL('@codingame/monaco-vscode-language-detection-worker-service-override/worker', import.meta.url), { type: 'module' })
}
export function registerWorkerLoader (label: string, workerLoader: WorkerLoader): void {
workerLoaders[label] = workerLoader
Expand Down

0 comments on commit c3592f4

Please sign in to comment.