mirror of https://github.com/buster-so/buster.git
Update setup workers
This commit is contained in:
parent
0d027823cb
commit
deab17ff37
|
@ -6,8 +6,9 @@ import { isServer } from '@/lib/window';
|
||||||
|
|
||||||
export const setupMonacoWebWorker = (): void => {
|
export const setupMonacoWebWorker = (): void => {
|
||||||
if (!isServer) {
|
if (!isServer) {
|
||||||
|
//@ts-expect-error
|
||||||
window.MonacoEnvironment = {
|
window.MonacoEnvironment = {
|
||||||
getWorker(_moduleId, label) {
|
getWorker(_moduleId: string, label: string) {
|
||||||
switch (label) {
|
switch (label) {
|
||||||
case 'editorWorkerService':
|
case 'editorWorkerService':
|
||||||
return new Worker(editorWorkerUrl);
|
return new Worker(editorWorkerUrl);
|
||||||
|
@ -16,7 +17,7 @@ export const setupMonacoWebWorker = (): void => {
|
||||||
case 'yaml':
|
case 'yaml':
|
||||||
return new Worker(yamlWorkerUrl);
|
return new Worker(yamlWorkerUrl);
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unknown label ${label}`);
|
throw new Error(`Unknown label ${label as string}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue