zikaari / monaco-editor-textmate

MIT License
122 stars 16 forks source link

How to use without webpack #21

Closed Ethan-Arrowood closed 2 years ago

Ethan-Arrowood commented 2 years ago

In this project readme you state it is recommended to use this webpack plugin to disable the included language things.

you're advised to use Webpack with monaco-editor-webpack-plugin which allows you to control which of "built-in" languages should monaco-editor use/bundle, leaving the rest.

But what if I'm not using webpack? Is there a way to do this using the monaco api? Even if its messy/ requires some async grossness?

zikaari commented 2 years ago

Are you using any bundler at all?

Ethan-Arrowood commented 2 years ago

My build tool is Snowpack. Not sure if is doing any bundling for dev.

For prod they recommend bundling with webpack though

QuevedoIB commented 2 years ago

Hi, I'm using Vite and I would like to know if it's possible to make this package work without webpack. I've followed all the steps but the one with the webpack plugin excluding languages.

zikaari commented 2 years ago

Unfortunately, I do not have any experience with any of those tools, so I can't really point you in a straight direction. I can advise on hacking by using resolve aliases. Find out what paths monaco tries to "require" when it attempts to bundle the languages, and then monkey patch those paths gracefully using aliases through a relevant config option provided by your bundler.