Skip to content

Commit 32bc7f6

Browse files
committed
Merge pull request #9 from benoror/master
commonjs package manager support (fix #8)
2 parents eccf033 + 0d8f6a0 commit 32bc7f6

7 files changed

+32
-16
lines changed

Gruntfile.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ module.exports = function(grunt) {
4141
options: {
4242
report: 'min',
4343
enclose: {
44-
'this': 'window',
45-
'this.angular': 'angular',
46-
'void 0': 'undefined'
44+
'angular': 'angular'
4745
},
4846
banner: '/*\n <%= bwr.name %> - v<%= bwr.version %> \n ' +
49-
'<%= grunt.template.today("yyyy-mm-dd") %>\n*/\n'+
50-
'',
47+
'<%= grunt.template.today("yyyy-mm-dd") %>\n*/\n\n'+
48+
'/* commonjs package manager support (eg componentjs) */\n'+
49+
'if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports) {\n'+
50+
' module.exports = "angular-md5";\n'+
51+
'}\n',
5152
},
5253
dist: {
5354
options: {

angular-md5.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
/*
2-
angular-md5 - v0.1.7
3-
2014-01-20
2+
angular-md5 - v0.1.8
3+
2015-07-27
44
*/
5-
(function(window, angular, undefined) {
5+
6+
/* commonjs package manager support (eg componentjs) */
7+
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports) {
8+
module.exports = "angular-md5";
9+
}
10+
(function(angular) {
611
angular.module("angular-md5", [ "gdi2290.md5" ]);
712
angular.module("ngMd5", [ "gdi2290.md5" ]);
813
angular.module("gdi2290.md5", [ "gdi2290.gravatar-filter", "gdi2290.md5-service", "gdi2290.md5-filter" ]);
@@ -197,4 +202,4 @@
197202
};
198203
return md5;
199204
} ]);
200-
})(this, this.angular, void 0);
205+
})(angular);

angular-md5.min.js

+8-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)