From 8d61a89d7b22bd16819c3bdfcf1607805d572a6c Mon Sep 17 00:00:00 2001 From: garthenweb Date: Wed, 14 Oct 2015 22:43:16 +0200 Subject: [PATCH] Fix UMD definition for commonjs --- src/dragdealer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dragdealer.js b/src/dragdealer.js index afc5c79..affbb16 100644 --- a/src/dragdealer.js +++ b/src/dragdealer.js @@ -10,6 +10,11 @@ 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 enviroments that support module.exports, + // like Node. + module.exports.Dragdealer = factory(); } else { // Browser globals root.Dragdealer = factory();