diff --git a/src/utils/dependency.ts b/src/utils/dependency.ts index 3fba352..ce64012 100644 --- a/src/utils/dependency.ts +++ b/src/utils/dependency.ts @@ -12,18 +12,11 @@ export interface Dependency { } export type Cdn = 'unpkg' | 'jsdelivr' | 'jsdelivr-fastly' -export const cdn = useLocalStorage('setting-cdn', 'jsdelivr-fastly') +export const cdn = useLocalStorage('setting-cdn', 'https://unpkg.com') export function genCdnLink(pkg: string, version: string | undefined, path: string) { version = version ? `@${version}` : '' - switch (cdn.value) { - case 'jsdelivr': - return `https://cdn.jsdelivr.net/npm/${pkg}${version}${path}` - case 'jsdelivr-fastly': - return `https://fastly.jsdelivr.net/npm/${pkg}${version}${path}` - case 'unpkg': - return `https://unpkg.com/${pkg}${version}${path}` - } + return `${cdn.value}/${pkg}${version}${path}` } export function genVueLink(version: string) {