-
Notifications
You must be signed in to change notification settings - Fork 214
Open
Description
Hi
first thanks your our excellent plugins
had a wee issue with aliased modules e.g. with explicit paths
requirejs.config({
paths: {
"noext": '../../shared/js/requirejs/plugins/0.3.2/noext',
"dynamicstripconfig": "../php/domain/config.php"
}
});
It was breaking the "toUrl" translation between "dynamicstripconfig" to "../php/domain/config.php" inside requirejs
Rewrote "noext" so it now wait till the "load" instead of the "normalize" to inject the query string to interrupt the ".js" postfixing
New noext.js ->
/** @license
* RequireJS plugin for loading files without adding the JS extension, useful for
* JSONP services and any other kind of resource that already contain a file
* extension or that shouldn't have one (like dynamic scripts).
* Author: Miller Medeiros (0 - 0.3.1)
* Author: Anthony Mckale (0.3.2)
* Version: 0.3.2 (2014/03/10)
* 0.3.2 - Moved parameter add to load, so we could use paths with this extension
*
* Released under the MIT license
*/
define(function(){
var QUERY_PARAM = 'noext';
//API
return {
load : function(name, req, onLoad, config) {
var rawrequireurl = req.toUrl(name);
rawrequireurl += (rawrequireurl.indexOf('?') < 0)? '?' : '&';
rawrequireurl += QUERY_PARAM +'=1';
req([rawrequireurl], function(mod){
onLoad(mod);
});
},
normalize : function(name, norm){
return name;
}
};
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels