Skip to content

feat: serve Monaco editor from local bundle instead of CDN#5607

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/change-monaco-to-local-deployment
Draft

feat: serve Monaco editor from local bundle instead of CDN#5607
Copilot wants to merge 2 commits intomasterfrom
copilot/change-monaco-to-local-deployment

Conversation

Copy link
Contributor

Copilot AI commented Mar 1, 2026

Monaco editor was loaded via jsdelivr.net CDN, causing "load failed" on air-gapped or CDN-blocked servers.

Changes

  • vite.config.ts — add vite-plugin-monaco-editor plugin; builds Monaco workers into dist/monacoeditorwork/ and wires up MonacoEnvironment.getWorkerUrl automatically
  • main.ts — replace CDN loader.config({ paths: { vs: '...' } }) with direct local import:
    import * as monaco from 'monaco-editor';
    loader.config({ monaco });
    This bypasses @monaco-editor/loader's AMD/CDN path entirely in favour of the already-bundled monaco-editor npm package
  • package.json — add vite-plugin-monaco-editor@1.1.0 as devDependency
Original prompt

This section details on the original issue you should resolve

<issue_title>希望Monaco编辑器从cdn部署改为本地部署</issue_title>
<issue_description>### Description / 描述

我在服务器上编辑mcp服务器时遇到webui加载失败错误,看了一下网页源码发现cdn部署的monaco无法使用,我的服务器ping不通,所以希望改成本地部署的编辑器

Use Case / 使用场景

Image

Willing to Submit PR? / 是否愿意提交PR?

  • Yes, I am willing to submit a PR. / 是的,我愿意提交 PR。

Code of Conduct

  • I have read and agree to abide by the project's Code of Conduct. /
    </issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
Copilot AI changed the title [WIP] Change Monaco editor deployment from CDN to local feat: serve Monaco editor from local bundle instead of CDN Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

希望Monaco编辑器从cdn部署改为本地部署

2 participants