chore: code-editor

This commit is contained in:
xiaojunnuo
2025-04-07 23:52:21 +08:00
parent 2e0c067cd2
commit 9475f2e56c
12 changed files with 551 additions and 98 deletions

View File

@@ -0,0 +1,37 @@
export async function importJsYaml() {
return await import("js-yaml");
}
export async function importYamlContribution() {
await import("monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution");
}
export async function importJsonContribution() {
await import("monaco-editor/esm/vs/language/json/monaco.contribution");
}
export async function importJavascriptContribution() {
await import("monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution");
}
export async function importMonacoYaml() {
return await import("monaco-yaml");
}
export async function importWorks() {
const editorWorker = await import("monaco-editor/esm/vs/editor/editor.worker?worker");
const jsonWorker = await import("monaco-editor/esm/vs/language/json/json.worker?worker");
const cssWorker = await import("monaco-editor/esm/vs/language/css/css.worker?worker");
const htmlWorker = await import("monaco-editor/esm/vs/language/html/html.worker?worker");
const tsWorker = await import("monaco-editor/esm/vs/language/typescript/ts.worker?worker");
const yamlWorker = await import("./yaml.worker?worker");
return {
editorWorker,
jsonWorker,
cssWorker,
htmlWorker,
tsWorker,
yamlWorker,
};
}