mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Renamed r.js to r-jqm.js
This commit is contained in:
parent
ff25bcc662
commit
4d4866c017
2 changed files with 9051 additions and 7 deletions
9029
js/r-jqm.js
Normal file
9029
js/r-jqm.js
Normal file
File diff suppressed because it is too large
Load diff
29
js/r.js
29
js/r.js
|
|
@ -8809,18 +8809,31 @@ function (lang, logger, file, parse, optimize, pragma,
|
|||
|
||||
currContents = build.toTransport(anonDefRegExp, namespace, moduleName, path, currContents, layer);
|
||||
|
||||
//Added for jQuery Mobile build as we are only interested in the dependency resolution
|
||||
currContents = currContents.replace(/^\[[^\]]+\]\s*,?[);]*\s*/m, "")
|
||||
.replace(/^function.*$/m, "(function( $, undefined ) {")
|
||||
.replace(/\);?\s*$/, "( jQuery ));")
|
||||
.replace(/^require\(\s*[^\]]*].*;\n?/, ""); // Get rid of the require block
|
||||
|
||||
//Semicolon is for files that are not well formed when
|
||||
//concatenated with other content.
|
||||
fileContents += "\n" + addSemiColon(currContents);
|
||||
}
|
||||
|
||||
buildFileContents += path.replace(config.dir, "") + "\n";
|
||||
//Some files may not have declared a require module, and if so,
|
||||
//put in a placeholder call so the require does not try to load them
|
||||
//after the module is processed.
|
||||
//If we have a name, but no defined module, then add in the placeholder.
|
||||
if (moduleName && !layer.modulesWithNames[moduleName] && !config.skipModuleInsertion) {
|
||||
//If including jquery, register the module correctly, otherwise
|
||||
//register an empty function. For jquery, make sure jQuery is
|
||||
//a real object, and perhaps not some other file mapping, like
|
||||
//to zepto.
|
||||
if (moduleName === 'jquery') {
|
||||
fileContents += '\n(function () {\n' +
|
||||
'var jq = typeof jQuery !== "undefined" && jQuery;\n' +
|
||||
namespace +
|
||||
'define("jquery", [], function () { return jq; });\n' +
|
||||
'}());\n';
|
||||
} else {
|
||||
fileContents += '\n' + namespace + 'define("' + moduleName + '", function(){});\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
@ -8882,7 +8895,9 @@ function (lang, logger, file, parse, optimize, pragma,
|
|||
}
|
||||
}
|
||||
|
||||
return suffix;
|
||||
return start + namespace + "define('" + moduleName + "'," +
|
||||
(deps ? ('[' + deps.toString() + '],') : '') +
|
||||
(namedModule ? namedFuncStart.replace(build.leadingCommaRegExp, '') : suffix);
|
||||
});
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue