Skip to content

Instantly share code, notes, and snippets.

@matesnippets
Created February 14, 2015 12:41
Show Gist options
  • Save matesnippets/734c28f8ce5c5d466250 to your computer and use it in GitHub Desktop.
Save matesnippets/734c28f8ce5c5d466250 to your computer and use it in GitHub Desktop.
Here's an example how to define prefixes for YepNope.
/*
* Get paths to the js files to use in yepnope
* window.thePath is defined in footer
*/
(function(yepnope) {
// Domain name
// var domain = window.location.host,
// origin = window.location.origin;
yepnope.addPrefix('pathBower', function(resourceObj) {
resourceObj.url = window.thePath + "/lib/" + resourceObj.url;
return resourceObj;
});
yepnope.addPrefix('pathScripts', function(resourceObj) {
resourceObj.url = window.thePath + "src/js/" + resourceObj.url;
return resourceObj;
});
yepnope.addPrefix('pathStyles', function(resourceObj) {
resourceObj.url = window.thePath + "/css/" + resourceObj.url;
return resourceObj;
});
})(this.yepnope);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment