Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: all cdn resources can be replaced #325

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wangcch
Copy link
Collaborator

@wangcch wangcch commented Mar 4, 2025

const store = useStore({
  resourceLinks: ref({
      esModuleShims: 'https://registry.npmmirror.com/es-module-shims/1.5.18/files/dist/es-module-shims.wasm.js',
      pkgLatestVersionUrl: (pkgName: string) => `https://registry.npmmirror.com/${pkgName}/latest/files/package.json`,
      pkgDirUrl: (pkgName: string, pkgVersion: string, pkgPath: string) => `https://registry.npmmirror.com/${pkgName}/${pkgVersion}/files/${pkgPath}/?meta`,
      pkgFileTextUrl: (pkgName: string, pkgVersion: string | undefined, pkgPath: string) => `https://registry.npmmirror.com/${pkgName}/${pkgVersion || 'latest'}/files/${pkgPath}`,
      typescriptLib: (version) => `https://registry.npmmirror.com/typescript/${version}/files/lib/typescript.js`,
  }),
})
export type ResourceLinkConfigs = {
  esModuleShims?: string
  vueCompilerUrl?: (version: string) => string
  typescriptLib?: (version: string) => string

  // for monaco
  pkgLatestVersionUrl?: (pkgName: string) => string
  pkgDirUrl?: (pkgName: string, pkgVersion: string, pkgPath: string) => string
  pkgFileTextUrl?: (pkgName: string, pkgVersion: string | undefined, pkgPath: string) => string
}

close #280 #159

Copy link

vercel bot commented Mar 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
repl ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2025 5:16pm

Copy link

pkg-pr-new bot commented Mar 4, 2025

Open in Stackblitz

npm i https://pkg.pr.new/@vue/repl@325

commit: 02b148e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature]cdn.jsdelivr.net address change
1 participant