Closed okikio closed 2 years ago
You can try to use the use the customWorkers options to specified absolute path:
monacoEditorPlugin({
customWorkers: [
{
label: "share",
entry: path.resolve(__dirname, "src/worker/share.worker")
}
]
})
Thank you, I truly appreciate it. You might want to add to the readme that you can use SharedWorkers.
The new SharedWorker(/* ... */)
should be write into the file src/worker/share.worker
Monaco uses up a lot of memory, so, I prefer to put workers in
SharedWorkers
. For the astro playground, I usedSharedWorkers
to limit memory usage and ensure that multiple monaco editors can still work properly, you check out how I used it here https://github.com/snowpackjs/astro-repl/blob/741460dfcbe894473f8e66153926cc653d0fe8b9/src/editor/modules/monaco.ts#L258Would it be possible to support SharedWorkers?