2026-03-12 17:27:07 +08:00

16 lines
379 B
TypeScript

let cached: Promise<typeof import('monaco-editor')> | undefined;
export default () => {
if (!cached) {
cached = Promise.all([import('emmet-monaco-es'), import('monaco-editor')]).then(([emmet, monaco]) => {
const { emmetHTML, emmetCSS } = emmet;
emmetHTML(monaco);
emmetCSS(monaco, ['css', 'scss']);
return monaco;
});
}
return cached;
};