mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-01-13 01:44:12 +00:00
fixed. 演练场静态打包问题
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -1062,12 +1062,18 @@ function parseById(shareLinkInfo, http, logger) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 配置Monaco Editor使用国内CDN (npmmirror)
|
||||
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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const monaco = await loader.init();
|
||||
if (monaco) {
|
||||
|
||||
Reference in New Issue
Block a user