Support AMD and CommonJS out of the box
This commit is contained in:
Vendored
+15
-4
@@ -23,9 +23,8 @@ THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// lib/handlebars/browser-prefix.js
|
||||
var Handlebars = {};
|
||||
|
||||
(function(Handlebars, undefined) {
|
||||
(function(undefined) {
|
||||
var Handlebars = {};
|
||||
;
|
||||
// lib/handlebars/base.js
|
||||
|
||||
@@ -2235,5 +2234,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);
|
||||
;
|
||||
|
||||
Vendored
+15
-4
@@ -23,9 +23,8 @@ THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// lib/handlebars/browser-prefix.js
|
||||
var Handlebars = {};
|
||||
|
||||
(function(Handlebars, undefined) {
|
||||
(function(undefined) {
|
||||
var Handlebars = {};
|
||||
;
|
||||
// lib/handlebars/base.js
|
||||
|
||||
@@ -341,5 +340,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);
|
||||
;
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
var Handlebars = {};
|
||||
|
||||
(function(Handlebars, undefined) {
|
||||
(function(undefined) {
|
||||
var Handlebars = {};
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user