summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/browser-suffix.js
diff options
context:
space:
mode:
authorKevin Decker <kpdecker@gmail.com>2013-05-31 12:37:16 -0700
committerKevin Decker <kpdecker@gmail.com>2013-05-31 12:37:16 -0700
commitcaded1d06b4d38e1bd948c1df5ecdf15c2ebe468 (patch)
tree9394a4b6b35728987c8ccfb8952307afd370ff1b /lib/handlebars/browser-suffix.js
parente6b6ae8fdb39be2d188d1b084add7e894057c5bc (diff)
parentefca3c8ef5665fe3cf2802f866db0c73755824e0 (diff)
downloadhandlebars.js-caded1d06b4d38e1bd948c1df5ecdf15c2ebe468.zip
handlebars.js-caded1d06b4d38e1bd948c1df5ecdf15c2ebe468.tar.gz
handlebars.js-caded1d06b4d38e1bd948c1df5ecdf15c2ebe468.tar.bz2
Merge pull request #537 from spikebrehm/support-all-the-modules
Support AMD and CommonJS out of the box
Diffstat (limited to 'lib/handlebars/browser-suffix.js')
-rw-r--r--lib/handlebars/browser-suffix.js14
1 files changed, 13 insertions, 1 deletions
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);