Skip to content

Commit

Permalink
Merge pull request beautifier#274 from sapienlab/master
Browse files Browse the repository at this point in the history
Add support for Asynchronous Module Definition (AMD) API
  • Loading branch information
bitwiseman committed Jun 9, 2013
2 parents 151f213 + 1b856de commit 812dd55
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions js/lib/beautify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1527,9 +1527,17 @@

if (typeof define === "function") {
// Add support for require.js
define(function(require, exports, module) {
exports.js_beautify = js_beautify;
});
if(typeof define.amd === "undefined") {
define(function(require, exports, module) {
exports.js_beautify = js_beautify;
});
} else {
// if is AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
define([], function() {
return js_beautify;
});
}

} else if (typeof exports !== "undefined") {
// Add support for CommonJS. Just put this file somewhere on your require.paths
// and you will be able to `var js_beautify = require("beautify").js_beautify`.
Expand Down

0 comments on commit 812dd55

Please sign in to comment.