Added wrapper to export as an AMD modules

removed jquery.mobile.exports
This commit is contained in:
Ghislain Seguin 2012-01-12 17:45:47 -08:00 committed by scottjehl
parent b33c4fb815
commit 1a58e2ae37
4 changed files with 17 additions and 8 deletions

View file

@ -117,9 +117,11 @@ js: init
-classpath build/js.jar:build/google-compiler-20111003.jar org.mozilla.javascript.tools.shell.Main \
external/r.js/dist/r.js \
-o baseUrl="js" \
include=jquery.mobile,jquery.mobile.exports exclude=jquery,order \
include=jquery.mobile exclude=jquery,order \
out=${OUTPUT}/${NAME}.compiled.js \
pragmasOnSave.jqmBuildExclude=true \
wrap.start=build/wrap.start \
wrap.end=build/wrap.end \
findNestedDependencies=true \
skipModuleInsertion=true \
optimize=none

2
build/wrap.end Normal file
View file

@ -0,0 +1,2 @@
}));

12
build/wrap.start Normal file
View file

@ -0,0 +1,12 @@
(function ( root, doc, factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define( [ "jquery" ], function ( $ ) {
factory( $, root, doc );
return $.mobile;
});
} else {
// Browser globals
factory( root.jQuery, root, doc );
}
}( this, document, function ( $, window, document, undefined ) {

View file

@ -1,7 +0,0 @@
(function( $ ) {
if ( typeof define === "function" && define.amd ) {
define( "jquery.mobile", [], function () { return $.mobile; } );
}
}( jQuery ));