We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f07e6a commit b7c548bCopy full SHA for b7c548b
1 file changed
packages/build/vite-config/src/localCdnFile/copyBundleDeps.js
@@ -15,6 +15,18 @@ const { readJsonSync } = fs
15
export function extraBundleCdnLink(filename, originCdnPrefix) {
16
const result = new Set()
17
const bundle = readJsonSync(filename)
18
+ // 兼容旧版的 npm 协议
19
+ bundle.data?.materials?.components?.forEach((component) => {
20
+ if (component.npm) {
21
+ const possibleUrl = [component.npm.script, component.npm.css]
22
+ possibleUrl.forEach((url) => {
23
+ if (url?.startsWith(originCdnPrefix) && !result.has(url)) {
24
+ result.add(url)
25
+ }
26
+ })
27
28
29
+
30
bundle.data?.materials?.packages?.forEach((packageItem) => {
31
if (packageItem) {
32
const possibleUrl = [packageItem.script, packageItem.css]
0 commit comments