Use monaco-editor loaded from CDN in Vue 2&3, no need to bundling.
The monaco-vue is a Vue plugin that allows users to use the monaco-editor directly loaded from a CDN in both Vue 2 and Vue 3 without the need for bundling. It addresses the issue of large bundled files caused by the monaco-editor not supporting ESM effectively. The plugin provides lazy loading of editor files from a CDN, making it easier to use the monaco-editor in Vue projects.
To install the monaco-vue plugin, the following steps need to be followed:
npm install monaco-vue
For Vue <= 2.6.14, also install @vue/composition-api:
npm install @vue/composition-api
The monaco-vue plugin offers a convenient solution for using the monaco-editor in Vue projects without dealing with the challenges of bundling. By enabling remote loading of editor files from a CDN, it streamlines the integration process and provides Vue developers with a seamless editing experience.