mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-07-09 19:41:11 +08:00
16 lines
379 B
TypeScript
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;
|
|
};
|