Skip to content
This repository has been archived by the owner on Jun 8, 2018. It is now read-only.

Commit

Permalink
Improve support for Baidu CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
Synzvato committed Jul 1, 2018
1 parent 2893c5d commit c02f290
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
23 changes: 23 additions & 0 deletions core/mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion modules/internal/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit c02f290

Please sign in to comment.