From 02baaf67f77f883c1510caa4c3b410d8ddf8975e Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Thu, 22 Dec 2011 15:52:34 -0800 Subject: [PATCH] Expose jquery.mobile as an AMD module if running in an AMD env --- Makefile | 2 +- js/jquery.mobile.exports.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 js/jquery.mobile.exports.js diff --git a/Makefile b/Makefile index 8765bbaf..88719401 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,7 @@ init: js: init # Build the JavaScript file @@node external/r.js -o baseUrl="js" \ - include=jquery.mobile exclude=jquery,order \ + include=jquery.mobile,jquery.mobile.exports exclude=jquery,order \ out=${OUTPUT}/${NAME}.tmp.js \ pragmasOnSave.jqmBuildExclude=true \ skipModuleInsertion=true \ diff --git a/js/jquery.mobile.exports.js b/js/jquery.mobile.exports.js new file mode 100644 index 00000000..cfe943d2 --- /dev/null +++ b/js/jquery.mobile.exports.js @@ -0,0 +1,7 @@ +(function( $ ) { + +if ( typeof define === "function" && define.amd ) { + define( "jquery.mobile", [], function () { return $.mobile; } ); +} + +}( jQuery ));