From c02f290a54be5e801cc2f8df7715444eb6b9e52b Mon Sep 17 00:00:00 2001 From: Thomas Rientjes Date: Sun, 1 Jul 2018 21:40:26 +0200 Subject: [PATCH] Improve support for Baidu CDN --- core/mappings.js | 23 +++++++++++++++++++++++ modules/internal/helpers.js | 4 +++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/core/mappings.js b/core/mappings.js index 2f2a8b4..dab3def 100644 --- a/core/mappings.js +++ b/core/mappings.js @@ -184,6 +184,29 @@ var mappings = { } }, // Baidu CDN + 'apps.bdimg.com': { + '/libs/': { + 'angular.js/{version}/angular.': resources.angular, + 'backbone.js/{version}/backbone.': resources.backbone, + 'backbone.js/{version}/backbone-min.': resources.backbone, + 'dojo/{version}/dojo.': resources.dojo, + 'ember.js/{version}/ember.': resources.ember, + 'ext-core/{version}/ext-core.': resources.extCore, + 'jquery/{version}/jquery.': resources.jQuery, + 'jqueryui/{version}/jquery-ui.js': resources.jQueryUI, + 'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI, + 'mootools/{version}/mootools-yui-compressed.': resources.mootools, + 'prototype/{version}/prototype.': resources.prototypeJS, + 'scriptaculous/{version}/scriptaculous.': resources.scriptaculous, + 'swfobject/{version}/swfobject.': resources.swfobject, + 'swfobject/{version}/swfobject_src.': resources.swfobject, + 'underscore.js/{version}/underscore.': resources.underscore, + 'underscore.js/{version}/underscore-min.': resources.underscore, + 'webfont/{version}/webfont.': resources.webfont, + 'webfont/{version}/webfont_debug.': resources.webfont + } + }, + // Baidu CDN [Deprecated] 'libs.baidu.com': { '/': { 'backbone/{version}/backbone.': resources.backbone, diff --git a/modules/internal/helpers.js b/modules/internal/helpers.js index 9bacc05..58ccdd2 100644 --- a/modules/internal/helpers.js +++ b/modules/internal/helpers.js @@ -160,8 +160,10 @@ helpers.determineCdnName = function (domainName) { return 'Yandex CDN'; case 'yandex.st': return 'Yandex CDN [Deprecated]'; - case 'libs.baidu.com': + case 'apps.bdimg.com': return 'Baidu CDN'; + case 'libs.baidu.com': + return 'Baidu CDN [Deprecated]'; case 'lib.sinaapp.com': return 'Sina Public Resources'; case 'upcdn.b0.upaiyun.com':