require-basket-load.js 793 B

12345678910111213141516171819
  1. ;(function () {
  2. var original_loader = requirejs.load;
  3. requirejs.load = function (context, moduleName, url) {
  4. var config = requirejs.s.contexts._.config;
  5. if (config.basket && config.basket.excludes && config.basket.excludes.indexOf(moduleName) !== -1) {
  6. original_loader(context, moduleName, url);
  7. } else {
  8. var unique = 1;
  9. if(config.basket && config.basket.unique && config.basket.unique.hasOwnProperty(moduleName) ){
  10. unique = config.basket.unique[moduleName];
  11. }
  12. basket.require({ url: url,unique:unique }).then(function () {
  13. context.completeLoad(moduleName);
  14. }, function (error) {
  15. context.onError(error);
  16. });
  17. }
  18. };
  19. }());