Snowpack and electron support
See original GitHub issueThank your for these easy to use bindings.
Currently we are evaluating switching from webpack
to snowpack
and the major blocker currently Is getting monaco-editor
to work correctly. I’ve had success with using this module, but we can’t always rely on users being able to download monaco-editor
from the CDN.
Because of that I am trying to include the monaco-editor
sources in some way and got it mostly working on development builds with a simple mount in snowpack.config.js
module.exports = {
mount: {
'node_modules/monaco-editor/': {static: true, resolve:false, url: '/monaco-editor'},
},
...
}
and then using loader
like this in our root component:
loader.config(
{
paths: {
vs: "/monaco-editor/min/vs"
}
}
)
This works fine but shows some errors in the console because it can’t find the min-maps
.
I can’t get it to work with a production build, which is based on this configuration. I have tried using the ESM examples shown in this monaco-editor issue but could not get it to work either. Do you have any idea what might be needed? Any help would be greatly appreciated.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
I could manage to make it work both in dev & production by mounting it like:
and defining the path like:
The source-maps still don’t work like this, so I just disabled source map warnings in the electron instance.
But importing the built-in languages (html, json, …) fails. It tries to import them from
/vs/language
and not/monaco-editor/language
. Is there a way to define the paths for the languages @suren-atoyan?you also can try this approach