Skip to content

Commit 6e5f0df

Browse files
niksydmethvin
authored andcommitted
Build: add UMD support
Fixes #207 Closes #206 (cherry picked from commit f92c743)
1 parent 9ed02da commit 6e5f0df

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"scripts": {
2121
"test": "grunt"
2222
},
23+
"dependencies": {
24+
"jquery": ">=1.7.0 <3.0.0"
25+
},
2326
"devDependencies": {
2427
"chalk": "1.1.3",
2528
"commitplease": "2.3.1",

src/intro.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1-
(function( jQuery, window, undefined ) {
1+
;(function( factory ) {
2+
/* jshint browserify:true */
3+
if ( typeof define === "function" && define.amd ) {
4+
// AMD. Register as an anonymous module.
5+
define( [ "jquery" ], window, factory );
6+
} else if ( typeof module === "object" && module.exports ) {
7+
// Node/CommonJS
8+
module.exports = factory( require( "jquery" ), window );
9+
} else {
10+
// Browser globals
11+
factory( jQuery, window );
12+
}
13+
}(function( jQuery, window ) {
214
// See http://bugs.jquery.com/ticket/13335
315
// "use strict";

src/outro.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
2-
})( jQuery, window );
1+
return jQuery;
2+
}));

0 commit comments

Comments
 (0)