diff --git a/packages/design-core/scripts/localCdnFile/copyBundleDeps.js b/packages/design-core/scripts/localCdnFile/copyBundleDeps.js index ddc2e52eb..5cb31e927 100644 --- a/packages/design-core/scripts/localCdnFile/copyBundleDeps.js +++ b/packages/design-core/scripts/localCdnFile/copyBundleDeps.js @@ -5,7 +5,7 @@ import { configServerAddProxy } from '../vite-plugins/configureServerAddProxy' import { viteStaticCopy } from 'vite-plugin-static-copy' import { getCdnPathNpmInfoForSingleFile, - analysisPackageNeedToInstallAndModifyFilesMergeToSameVersion, + getPackageNeedToInstallAndFilesUsingSameVersion, dedupeCopyFiles, copyfileToDynamicSrcMapper } from './locateCdnNpmInfo' @@ -51,8 +51,7 @@ export function copyBundleDeps( const cdnFiles = extraBundleCdnLink(bundleFile, originCdnPrefix).map((url) => getCdnPathNpmInfoForSingleFile(url, originCdnPrefix, base, dir, false, bundleTempDir) ) - const { packages: packageNeedToInstall, files } = - analysisPackageNeedToInstallAndModifyFilesMergeToSameVersion(cdnFiles) + const { packages: packageNeedToInstall, files } = getPackageNeedToInstallAndFilesUsingSameVersion(cdnFiles) const plugin = (isDev) => { return [ diff --git a/packages/design-core/scripts/localCdnFile/copyImportMap.js b/packages/design-core/scripts/localCdnFile/copyImportMap.js index 2960b91c3..35d3fb275 100644 --- a/packages/design-core/scripts/localCdnFile/copyImportMap.js +++ b/packages/design-core/scripts/localCdnFile/copyImportMap.js @@ -1,6 +1,6 @@ import { viteStaticCopy } from 'vite-plugin-static-copy' import { - analysisPackageNeedToInstallAndModifyFilesMergeToSameVersion, + getPackageNeedToInstallAndFilesUsingSameVersion, copyfileToDynamicSrcMapper, dedupeCopyFiles, getCdnPathNpmInfoForPackage, @@ -30,7 +30,7 @@ export const copyLocalImportMap = ( .filter((styleUrl) => styleUrl.startsWith(originCdnPrefix)) .map((url) => getCdnPathNpmInfoForSingleFile(url, originCdnPrefix, publicPath, dir, false), bundleTempDir) - const { packages: packageNeedToInstall, files } = analysisPackageNeedToInstallAndModifyFilesMergeToSameVersion( + const { packages: packageNeedToInstall, files } = getPackageNeedToInstallAndFilesUsingSameVersion( importMapFiles.concat(styleFiles) ) diff --git a/packages/design-core/scripts/localCdnFile/copyPreviewImportMap.js b/packages/design-core/scripts/localCdnFile/copyPreviewImportMap.js index 92feb9b2c..050a7aa5b 100644 --- a/packages/design-core/scripts/localCdnFile/copyPreviewImportMap.js +++ b/packages/design-core/scripts/localCdnFile/copyPreviewImportMap.js @@ -1,7 +1,7 @@ import path from 'node:path' import { readJsonSync } from 'fs-extra' import { - analysisPackageNeedToInstallAndModifyFilesMergeToSameVersion, + getPackageNeedToInstallAndFilesUsingSameVersion, copyfileToDynamicSrcMapper, dedupeCopyFiles, getCdnPathNpmInfoForPackage, @@ -69,8 +69,7 @@ export function copyPreviewImportMap( } return getCdnPathNpmInfoForSingleFile(url, originCdnPrefix, base, dir, false, bundleTempDir) }) - const { packages: packageNeedToInstall, files } = - analysisPackageNeedToInstallAndModifyFilesMergeToSameVersion(cdnFiles) + const { packages: packageNeedToInstall, files } = getPackageNeedToInstallAndFilesUsingSameVersion(cdnFiles) return [ ...installPackageTemporary(packageNeedToInstall, bundleTempDir), ...viteStaticCopy({ diff --git a/packages/design-core/scripts/localCdnFile/locateCdnNpmInfo.js b/packages/design-core/scripts/localCdnFile/locateCdnNpmInfo.js index 5b2429242..17ed37fbe 100644 --- a/packages/design-core/scripts/localCdnFile/locateCdnNpmInfo.js +++ b/packages/design-core/scripts/localCdnFile/locateCdnNpmInfo.js @@ -170,7 +170,7 @@ export function dedupeCopyFiles(files) { }, []) } -export function analysisPackageNeedToInstallAndModifyFilesMergeToSameVersion(files) { +export function getPackageNeedToInstallAndFilesUsingSameVersion(files) { const packageNeedToInstall = files .filter((item) => !item.sourceExist) .map(({ packageName, version, sourceExistExternal: exist }) => ({ packageName, version, exist }))