Created
October 9, 2012 15:21
-
-
Save gdiaz/3859484 to your computer and use it in GitHub Desktop.
Requirejs problem
This file contains hidden or 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
nameToUrl: function (moduleName, ext) { | |
var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, | |
parentPath; | |
//If a colon is in the URL, it indicates a protocol is used and it is just | |
//an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) | |
//or ends with .js, then assume the user meant to use an url and not a module id. | |
//The slash is important for protocol-less URLs as well as full paths. | |
if (req.jsExtRegExp.test(moduleName)) { | |
//Just a plain path, not module name lookup, so just return it. | |
//Add extension if it is included. This is a bit wonky, only non-.js things pass | |
//an extension, this method probably needs to be reworked. | |
url = moduleName + (ext || ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment