fixed. 演练场静态打包问题

This commit is contained in:
q
2026-01-04 09:29:20 +08:00
parent d8f0dc4f8e
commit 8127cd0758
8 changed files with 195 additions and 21 deletions

View File

@@ -94,13 +94,18 @@ export default {
return;
}
// 配置Monaco Editor使用国内CDN (npmmirror)
// npmmirror的路径格式: https://registry.npmmirror.com/包名/版本号/files/文件路径
loader.config({
paths: {
vs: 'https://registry.npmmirror.com/monaco-editor/0.55.1/files/min/vs'
}
});
// 配置Monaco Editor使用本地打包的文件而不是CDN
if (loader.config) {
const vsPath = process.env.NODE_ENV === 'production'
? './js/vs' // 生产环境使用相对路径
: '/js/vs'; // 开发环境使用绝对路径
loader.config({
paths: {
vs: vsPath
}
});
}
// 初始化Monaco Editor
monaco = await loader.init();