浏览代码

Replace unpkg w/ jsDelivr

SukkaW 1 年之前
父节点
当前提交
8e9afef2a3
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 1 1
      Build/build-sgmodule-redirect.ts
  2. 5 5
      Build/download-mock-assets.ts

+ 1 - 1
Build/build-sgmodule-redirect.ts

@@ -58,7 +58,7 @@ const REDIRECT_MIRROR_HEADER = [
   ['cdn.jsdmirror.cn/', 'https://cdn.jsdelivr.net/'],
   ['cdn.jsdmirror.cn/', 'https://cdn.jsdelivr.net/'],
   // onmicrosoft.cn
   // onmicrosoft.cn
   ['jsd.onmicrosoft.cn/', 'https://cdn.jsdelivr.net/'],
   ['jsd.onmicrosoft.cn/', 'https://cdn.jsdelivr.net/'],
-  ['npm.onmicrosoft.cn/', 'https://unpkg.com/'],
+  ['npm.onmicrosoft.cn/', 'https://cdn.jsdelivr.net/npm/'],
   ['cdnjs.onmicrosoft.cn/', 'https://cdnjs.cloudflare.com/ajax/libs/'],
   ['cdnjs.onmicrosoft.cn/', 'https://cdnjs.cloudflare.com/ajax/libs/'],
   // KGitHub
   // KGitHub
   ['raw.kgithub.com/', 'https://raw.githubusercontent.com/'],
   ['raw.kgithub.com/', 'https://raw.githubusercontent.com/'],

+ 5 - 5
Build/download-mock-assets.ts

@@ -7,11 +7,11 @@ import { mkdirp } from './lib/misc';
 import { $$fetch } from './lib/fetch-retry';
 import { $$fetch } from './lib/fetch-retry';
 
 
 const ASSETS_LIST = {
 const ASSETS_LIST = {
-  'www-google-analytics-com_ga.js': 'https://unpkg.com/@adguard/scriptlets@latest/dist/redirect-files/google-analytics-ga.js',
-  'www-googletagservices-com_gpt.js': 'https://unpkg.com/@adguard/scriptlets@latest/dist/redirect-files/googletagservices-gpt.js',
-  'www-google-analytics-com_analytics.js': 'https://unpkg.com/@adguard/scriptlets@latest/dist/redirect-files/google-analytics.js',
-  'www-googlesyndication-com_adsbygoogle.js': 'https://unpkg.com/@adguard/scriptlets@latest/dist/redirect-files/googlesyndication-adsbygoogle.js',
-  'amazon-adsystem-com_amazon-apstag.js': 'https://unpkg.com/@adguard/scriptlets@latest/dist/redirect-files/amazon-apstag.js'
+  'www-google-analytics-com_ga.js': 'https://cdn.jsdelivr.net/npm/@adguard/scriptlets@latest/dist/redirect-files/google-analytics-ga.js',
+  'www-googletagservices-com_gpt.js': 'https://cdn.jsdelivr.net/npm/@adguard/scriptlets@latest/dist/redirect-files/googletagservices-gpt.js',
+  'www-google-analytics-com_analytics.js': 'https://cdn.jsdelivr.net/npm/@adguard/scriptlets@latest/dist/redirect-files/google-analytics.js',
+  'www-googlesyndication-com_adsbygoogle.js': 'https://cdn.jsdelivr.net/npm/@adguard/scriptlets@latest/dist/redirect-files/googlesyndication-adsbygoogle.js',
+  'amazon-adsystem-com_amazon-apstag.js': 'https://cdn.jsdelivr.net/npm/@adguard/scriptlets@latest/dist/redirect-files/amazon-apstag.js'
 } as const;
 } as const;
 
 
 export const downloadMockAssets = task(require.main === module, __filename)(async (span) => {
 export const downloadMockAssets = task(require.main === module, __filename)(async (span) => {