Add an available CDN servers

This commit is contained in:
Namhyeon Go 2025-05-05 19:13:41 +09:00
parent a5fc5de78f
commit 302e7ce4fc
4 changed files with 43 additions and 1 deletions

View File

@ -60,6 +60,15 @@ namespace WelsonJS.Launcher.Properties {
}
}
/// <summary>
/// https://ajax.aspnetcdn.com/과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string AspNetCdnPrefix {
get {
return ResourceManager.GetString("AspNetCdnPrefix", resourceCulture);
}
}
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
@ -160,6 +169,15 @@ namespace WelsonJS.Launcher.Properties {
}
}
/// <summary>
/// https://ajax.googleapis.com/과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string GoogleApisPrefix {
get {
return ResourceManager.GetString("GoogleApisPrefix", resourceCulture);
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
@ -268,6 +286,15 @@ namespace WelsonJS.Launcher.Properties {
}
}
/// <summary>
/// https://polyfill-fastly.io/과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string PolyfillPrefix {
get {
return ResourceManager.GetString("PolyfillPrefix", resourceCulture);
}
}
/// <summary>
/// https://github.com/gnh1201/welsonjs과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>

View File

@ -205,4 +205,13 @@
<data name="UnpkgPrefix" xml:space="preserve">
<value>https://unpkg.com/</value>
</data>
<data name="AspNetCdnPrefix" xml:space="preserve">
<value>https://ajax.aspnetcdn.com/</value>
</data>
<data name="GoogleApisPrefix" xml:space="preserve">
<value>https://ajax.googleapis.com/</value>
</data>
<data name="PolyfillPrefix" xml:space="preserve">
<value>https://polyfill-fastly.io/</value>
</data>
</root>

View File

@ -201,12 +201,16 @@ namespace WelsonJS.Launcher
var sources = new (bool isMatch, string configKey, Func<string, string> transform)[]
{
(path.StartsWith("ajax/libs/"), "CdnJsPrefix", p => p),
(path.StartsWith("ajax/libs/"), "GoogleApisPrefix", p => p),
(isNodePackageExpression, "UnpkgPrefix", p => p),
(isNodePackageExpression, "SkypackPrefix", p => p),
(isNodePackageExpression, "EsmShPrefix", p => p),
(isNodePackageExpression, "EsmRunPrefix", p => p),
(path.StartsWith("npm/") || path.StartsWith("gh/") || path.StartsWith("wp/"), "JsDeliverPrefix", p => p),
(path.StartsWith("jquery/") && path.Length > "jquery/".Length, "JqueryCdnPrefix", p => p.Substring("jquery/".Length)),
(path.StartsWith("jquery/"), "JqueryCdnPrefix", p => p.Substring("jquery/".Length)),
(path.StartsWith("polyfill/"), "CdnJsPrefix", p => p), // polyfill.js from Cloudflare
(path.StartsWith("polyfill/"), "PolyfillPrefix", p => p.Substring("polyfill/".Length)), // polyfill.js from Fastly
(path.StartsWith("aspnet/"), "AspNetCdnPrefix", p => p.Substring("aspnet/".Length)),
(true, "BlobStoragePrefix", p => p) // fallback
};

View File

@ -20,6 +20,8 @@
<add key="EsmShPrefix" value="https://esm.sh/"/>
<add key="EsmRunPrefix" value="https://esm.run/"/>
<add key="JqueryCdnPrefix" value="https://code.jquery.com/"/>
<add key="AspNetCdnPrefix" value="https://ajax.aspnetcdn.com/"/>
<add key="GoogleApisPrefix" value="https://ajax.googleapis.com/"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>