mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 07:14:40 +08:00
fix(monaco): Ensure monaco loader uses the bundled ESM instance instead of CDN
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
- 修复 macOS 有线网络 DNS 劫持失败
|
||||
- 修复 Monaco 编辑器内右键菜单显示异常
|
||||
- 修复设置代理端口时检查端口占用
|
||||
- 修复 Monaco 编辑器初始化卡 Loading
|
||||
|
||||
<details>
|
||||
<summary><strong> ✨ 新增功能 </strong></summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { loader } from "@monaco-editor/react";
|
||||
import * as monaco from "monaco-editor";
|
||||
import editorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker";
|
||||
import cssWorker from "monaco-editor/esm/vs/language/css/css.worker?worker";
|
||||
import tsWorker from "monaco-editor/esm/vs/language/typescript/ts.worker?worker";
|
||||
@@ -5,6 +7,9 @@ import yamlWorker from "monaco-yaml/yaml.worker?worker";
|
||||
|
||||
type WorkerConstructor = new () => Worker;
|
||||
|
||||
// Ensure monaco loader uses the bundled ESM instance instead of CDN.
|
||||
loader.config({ monaco });
|
||||
|
||||
// Align with the former plugin mapping so Monaco can resolve its background workers.
|
||||
const workerConstructors: Record<string, WorkerConstructor> = {
|
||||
editorWorkerService: editorWorker,
|
||||
|
||||
Reference in New Issue
Block a user