diff --git a/DragonBones/src/dragonBones/core/DragonBones.ts b/DragonBones/src/dragonBones/core/DragonBones.ts index 5c5a962c..65295893 100644 --- a/DragonBones/src/dragonBones/core/DragonBones.ts +++ b/DragonBones/src/dragonBones/core/DragonBones.ts @@ -353,10 +353,6 @@ namespace dragonBones { } } // -if (typeof global === "undefined") { - var global = window as any; -} -// if (!console.warn) { console.warn = function () { }; } @@ -381,4 +377,21 @@ var __extends: any = function (t: any, e: any) { } } r.prototype = e.prototype, t.prototype = new (r as any)(); -}; \ No newline at end of file +}; +// +if (typeof global === "undefined") { + var global = window as any; +} +// +declare var exports: any; +declare var module: any; +declare var define: any; +if (typeof exports === "object" && typeof module === "object") { + module.exports = dragonBones; +} +else if (typeof define === "function" && define["amd"]) { + define(["dragonBones"], function () { return dragonBones; }); +} +else if (typeof exports === "object") { + exports["dragonBones"] = dragonBones; +} \ No newline at end of file