Emmet Plugin for monaco-editor
compatible with monaco-editor v0.12.0 and above
Treeshaking support
Source codes are well commented if you want to figure out how it works
Almost the same as VSCode's built-in emmet, integrated with completion provider.
Support HTML, CSS, LESS, SCSS
$ npm install emmet-monaco-esES Module
import { emmetHTML, emmetCSS } from "emmet-monaco-es";
// both `emmetHTML` and `emmetCSS` are used the same way
const dispose = emmetHTML(
// monaco-editor it self. If not provided, will use window.monaco instead.
// This could make the plugin support both ESM and AMD loaded monaco-editor
monaco
);
// run it if you want to dispose emmet
dispose();Browser
<script src="https://unpkg.com/emmet-monaco-es/dist/emmet-monaco.min.js"></script>
<script>
// NOTE: monaco-editor should be loaded first
// see above esm example for details
emmetMonaco.emmetHTML(monaco);
</script>MIT