Skip to content

Commit

Permalink
fix(monaco): load worker properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ForkKILLET committed Jan 7, 2023
1 parent 302b78f commit c7533a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 9 additions & 2 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ export default defineConfig(({ command }) => {
return {
plugins: [
vue(),
// @ts-ignore
monacoEditor.default({ languageWorkers: [] })
(monacoEditor as unknown as { default: typeof monacoEditor }).default({
languageWorkers: [],
customWorkers: [
{
label: 'editorWorkerService',
entry: 'monaco-editor/esm/vs/editor/editor.worker',
}
]
})
],
base: './',
resolve: {
Expand Down
3 changes: 0 additions & 3 deletions monaco/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ export const getMonacoForCuiping = (monaco: typeof Monaco, {
}
})

if (MonacoEnvironment) MonacoEnvironment.getWorkerUrl = () => 'data:application/javascript;base64,'
+ btoa(`console.log("Mocano, I DON'T NEED ANY WORKERS, YOU KNOW?")`)

return monaco
}

Expand Down

0 comments on commit c7533a3

Please sign in to comment.