mirror of
https://github.com/beautifier/js-beautify.git
synced 2024-11-27 14:40:23 +00:00
Add support for Asynchronous Module Definition (AMD) API
See http://requirejs.org/docs/whyamd.html
This commit is contained in:
parent
1fa788702f
commit
1b856de26c
@ -1510,9 +1510,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`.
|
||||
|
Loading…
Reference in New Issue
Block a user