fudgepop01 / svelte-monaco-editor-example

a basic example of using monaco editor with sveltejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

monaco editor in sveltejs

This is an example of how to incorperate monaco editor into a sveltejs project that uses rollup. This technique was shamlessly ripped straight from https://github.com/sveltejs/svelte-repl.

Here are the current limitations / things I don't yet know how to fix:

  • it's an esm export (meaning you'll need to import it using <script type="module" ...>)
  • rollup generates a new bundle for monaco and its dependencies every time you want to change the configuration a little.
  • it takes forever for rollup to bundle all the monaco stuff, possibly due to the 'this' has been replaced by 'undefined' warnings lol

anyway, here's how to start it upon cloning the repo:

npm install
npm run dev

About

a basic example of using monaco editor with sveltejs


Languages

Language:JavaScript 75.9%Language:HTML 20.3%Language:CSS 3.8%