-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to integrate a custom language's web worker into this library? #118
Comments
哈哈, 感觉这个库没人维护, 我也遇到同样的问题了。 |
自己写一个monaco editor for react , |
Hi there, |
@sabine19 I think you are asking multiple model. Please check the doc: https://github.com/suren-atoyan/monaco-react#multi-model-editor. This is a new feature in v4 |
@hacker0limbo thanks for the quick reply, but indeed I need a custom language worker. the multiple model setup is no issue. |
@sabine19 from my understanding, to custom a language worker, you might want to eject create-react-app and custom webpack config, this kind of violate the intention of this project:
I am not sure what functionality you want achieve, sometimes you can just use Monaco's native api to accomplish, although it might not sound efficient. |
Maybe i mixed up two issues: |
@sabine19 I am not a master of webpack as well, might not be able to help you with this, sorry about that |
The solution for getting custom web worker running is to bundle them for the output. Therefore you have to use react-app-rewired and the monaco-editor-webpack-plugin to be able to override webpack config without ejecting the project. |
Is your feature request related to a problem? Please describe.
Recently i wanna custom a language, and trying to add web worker with it as well. However it seems like on the doc there is nothing related to custom web worker.
Describe the solution you'd like
There is a related issue about integrate monaco-editor with create-react-app, the solution is using
react-app-rewired
and then addmonaco-editor-webpack-plugin
.Also on the monaco editor official doc, there are two general solutions for adding web worker.
Since this lib does not require any webpack config, but on the other hand there is no related web worker api exposed. I am currently not sure how to handle it.
Describe alternatives you've considered
The pseudocode might look like this:
Additional context
I am really new to monaco editor and english is not my first language, hope i explained my confusion clearly.
Cheers
The text was updated successfully, but these errors were encountered: