Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

make anime export as a UMD module

Max G J Panasb6b54342fbec
diff --git a/anime.js b/anime.js
index 43d0bd18..8af76eaa 100644
--- a/anime.js
+++ b/anime.js
@@ -7,8 +7,20 @@
* Released under the MIT license
*/
-var anime = (function() {
-
+(function (root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define([], factory);
+ } else if (typeof module === 'object' && module.exports) {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory();
+ } else {
+ // Browser globals (root is window)
+ root.anime = factory();
+ }
+}(this, function () {
// Defaults
var defaultSettings = {
@@ -590,4 +602,4 @@ var anime = (function() {
return animation;
-})();
+});