From 85e42b230ea4328ed1fefa76675aa6c425b7fbd9 Mon Sep 17 00:00:00 2001 From: rhlin Date: Mon, 13 May 2024 12:13:16 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=89=E6=96=B9cdn=E8=A7=A3=E8=80=A6?= =?UTF-8?q?=20=E4=BF=AE=E6=AD=A3preview=E8=84=9A=E6=9C=ACTinyVue=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design-core/scripts/localCdnFile/copyPreviewImportMap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/design-core/scripts/localCdnFile/copyPreviewImportMap.js b/packages/design-core/scripts/localCdnFile/copyPreviewImportMap.js index 1da97aa4f..206704659 100644 --- a/packages/design-core/scripts/localCdnFile/copyPreviewImportMap.js +++ b/packages/design-core/scripts/localCdnFile/copyPreviewImportMap.js @@ -14,7 +14,7 @@ export function extraPreviewImport(filename, originCdnPrefix) { const result = [] const importMap = readJsonSync(filename) Object.entries(importMap.imports)?.forEach(([_key, location]) => { - const url = location.replace('${VITE_CDN_DOMAIN}', originCdnPrefix).replace('${opentinyVueVersion}', '~3.11') + const url = location.replace('${VITE_CDN_DOMAIN}', originCdnPrefix).replace('${opentinyVueVersion}', '~3.14') if (url?.startsWith(originCdnPrefix) && !result.includes(url)) { result.push(url) } @@ -27,7 +27,7 @@ export function replacePreviewImport(importMap, fileMap, originCdnPrefix) { imports: Object.fromEntries( Object.entries(importMap.imports)?.map(([key, location]) => { // 这里的替换占位符规则等同于packages/design-core/src/preview/src/preview/importMap.js, 两边修改需要同步 - const url = location.replace('${VITE_CDN_DOMAIN}', originCdnPrefix).replace('${opentinyVueVersion}', '~3.11') + const url = location.replace('${VITE_CDN_DOMAIN}', originCdnPrefix).replace('${opentinyVueVersion}', '~3.14') const matchRule = fileMap.find((rule) => url === rule.originUrl) if (matchRule) { return [key, matchRule.newUrl]