Created
January 12, 2015 15:09
-
-
Save benmccormick/d2bc1b35ecd4eb78a4ac to your computer and use it in GitHub Desktop.
Configuration file to load a requirejs config both in gulp and the browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jshint ignore:start */ | |
/** This file is a bit of a hack to make the requireJS build paths available | |
* both in the browser and for gulp. There's some ugliness requires to make | |
* it loadable/usable in both environments. | |
**/ | |
var requirePaths = { | |
paths: { | |
jquery: 'vendor/jquery/jquery', | |
jqueryui: 'vendor/jquery/jquery.ui', | |
//... | |
}, | |
shim: { | |
/... | |
}}; | |
//if this is being pulled in as a node module, nest it, otherwise we'll | |
// run the browser specific logic | |
if (typeof exports !== 'undefined') { | |
exports.requirePaths = requirePaths; | |
}else if(require) { | |
var config = { | |
paths: requirePaths.paths, | |
shim: requirePaths.shim, | |
map: requirePaths.map, | |
baseUrl: static_url+'/js/' | |
}; | |
require.config(config); | |
} | |
/* jshint ignore:end *//* jshint ignore:start */ | |
/** This file is a bit of a hack to make the requireJS build paths available | |
* both in the browser and for gulp. There's some ugliness requires to make | |
* it loadable/usable in both environments. | |
**/ | |
var requirePaths = { | |
paths: { | |
jquery: 'vendor/jquery/jquery', | |
jqueryui: 'vendor/jquery/jquery.ui', | |
//... | |
}, | |
shim: { | |
/... | |
}}; | |
//if this is being pulled in as a node module, nest it, otherwise we'll | |
// run the browser specific logic | |
if (typeof exports !== 'undefined') { | |
exports.requirePaths = requirePaths; | |
}else if(require) { | |
var config = { | |
paths: requirePaths.paths, | |
shim: requirePaths.shim, | |
map: requirePaths.map, | |
baseUrl: static_url+'/js/' | |
}; | |
require.config(config); | |
} | |
/* jshint ignore:end */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment