Properly load monaco workers

This commit is contained in:
Sidharth Vinod
2023-04-20 12:20:46 +05:30
parent ab0bdf1780
commit 79fe5a79cd
+1 -10
View File
@@ -66,15 +66,6 @@
};
onMount(async () => {
const getWorkerModule = (moduleUrl: string, label: string) => {
return new Worker(
new URL('monaco-editor/esm/vs/' + moduleUrl + '.js?worker', import.meta.url),
{
name: label,
type: 'module'
}
);
};
self.MonacoEnvironment = {
getWorker(_, label) {
if (label === 'json') {
@@ -107,7 +98,7 @@
run: function () {
syncDiagram();
logEvent('renderDiagram', {
method: 'keyboadShortcut'
method: 'keyboardShortcut'
});
}
});