-
When building my project with vite, assets are built for an My editor should not support any of these languages and I have set editorAppConfig: {
$type: "extended",
loadThemes: false,
useDiffEditor: false,
htmlContainer: document.getElementById("monaco-editor-root") as HTMLElement,
monacoWorkerFactory: (logger) => {
useWorkerFactory({
workerOverrides: {
ignoreMapping: true,
workerLoaders: {
TextEditorWorker: () =>
new textEditorWorker(),
TextMateWorker: () =>
new textMateWorker(),
},
},
logger,
});
},
... Currently I remove the worker after the build, does anyone here know if there is a more elegant solution? :) |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
Hi @pbrostean when you completely remove or comment monaco-editor will always try to create its workers. We cannot prevent that. |
Beta Was this translation helpful? Give feedback.
-
Good Morning @kaisalmen, good to know. Then I will continue to handle this in the build process with a cleanup plugin. If I remove Relatedly, I have not yet fully understood whether these default workers are also automatically included in the editor. Attempts to specify the corresponding fileExt in codeResources (ts, html, css...) have not led to any noticeable support of the languages. |
Beta Was this translation helpful? Give feedback.
-
@pbrostean the editor worker is tried to be loaded by monaco-editor every time. If you use the extended mode (textmate is used) the standard monaco workers will not work. If you use monaco-editor the |
Beta Was this translation helpful? Give feedback.
-
@kaisalmen interesting, does that mean if I want to extend my editor for example with languages bundled in VSIX or the languages provided by codingame as npm I have to use it in the classic config? |
Beta Was this translation helpful? Give feedback.
-
I will create a new clean repo with the code above and share it, i will get back to you when done. |
Beta Was this translation helpful? Give feedback.
Hi @pbrostean when you completely remove or comment
monacoWorkerFactory
does monaco-editor print the warning in the console that no editor worker could be created and that it will run on main?monaco-editor will always try to create its workers. We cannot prevent that.