summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/handlebars.js19
-rw-r--r--dist/handlebars.runtime.js19
-rw-r--r--lib/handlebars/browser-prefix.js5
-rw-r--r--lib/handlebars/browser-suffix.js14
4 files changed, 45 insertions, 12 deletions
diff --git a/dist/handlebars.js b/dist/handlebars.js
index c70f09d..826449f 100644
--- a/dist/handlebars.js
+++ b/dist/handlebars.js
@@ -23,9 +23,8 @@ THE SOFTWARE.
*/
// lib/handlebars/browser-prefix.js
-var Handlebars = {};
-
-(function(Handlebars, undefined) {
+(function(undefined) {
+ var Handlebars = {};
;
// lib/handlebars/base.js
@@ -2274,5 +2273,17 @@ Handlebars.VM = {
Handlebars.template = Handlebars.VM.template;
;
// lib/handlebars/browser-suffix.js
-})(Handlebars);
+ if (typeof module === 'object' && module.exports) {
+ // CommonJS
+ module.exports = Handlebars;
+
+ } else if (typeof define === "function" && define.amd) {
+ // AMD modules
+ define(function() { return Handlebars; });
+
+ } else {
+ // other, i.e. browser
+ this.Handlebars = Handlebars;
+ }
+}).call(this);
;
diff --git a/dist/handlebars.runtime.js b/dist/handlebars.runtime.js
index b9f4e49..2e089c5 100644
--- a/dist/handlebars.runtime.js
+++ b/dist/handlebars.runtime.js
@@ -23,9 +23,8 @@ THE SOFTWARE.
*/
// lib/handlebars/browser-prefix.js
-var Handlebars = {};
-
-(function(Handlebars, undefined) {
+(function(undefined) {
+ var Handlebars = {};
;
// lib/handlebars/base.js
@@ -358,5 +357,17 @@ Handlebars.VM = {
Handlebars.template = Handlebars.VM.template;
;
// lib/handlebars/browser-suffix.js
-})(Handlebars);
+ if (typeof module === 'object' && module.exports) {
+ // CommonJS
+ module.exports = Handlebars;
+
+ } else if (typeof define === "function" && define.amd) {
+ // AMD modules
+ define(function() { return Handlebars; });
+
+ } else {
+ // other, i.e. browser
+ this.Handlebars = Handlebars;
+ }
+}).call(this);
;
diff --git a/lib/handlebars/browser-prefix.js b/lib/handlebars/browser-prefix.js
index 138467d..a8f1722 100644
--- a/lib/handlebars/browser-prefix.js
+++ b/lib/handlebars/browser-prefix.js
@@ -1,3 +1,2 @@
-var Handlebars = {};
-
-(function(Handlebars, undefined) {
+(function(undefined) {
+ var Handlebars = {};
diff --git a/lib/handlebars/browser-suffix.js b/lib/handlebars/browser-suffix.js
index 36c52c0..d357c72 100644
--- a/lib/handlebars/browser-suffix.js
+++ b/lib/handlebars/browser-suffix.js
@@ -1 +1,13 @@
-})(Handlebars);
+ if (typeof module === 'object' && module.exports) {
+ // CommonJS
+ module.exports = Handlebars;
+
+ } else if (typeof define === "function" && define.amd) {
+ // AMD modules
+ define(function() { return Handlebars; });
+
+ } else {
+ // other, i.e. browser
+ this.Handlebars = Handlebars;
+ }
+}).call(this);