diff --git a/src/jquery.collision.js b/src/jquery.collision.js index 4a15e8e3..a81d4140 100644 --- a/src/jquery.collision.js +++ b/src/jquery.collision.js @@ -7,8 +7,9 @@ */ ;(function(root, factory) { - - if (typeof define === 'function' && define.amd) { + if (typeof exports === 'object') { + module.exports = factory(require('jquery'), require('./jquery.coords.js')); + } else if (typeof define === 'function' && define.amd) { define('gridster-collision', ['jquery', 'gridster-coords'], factory); } else { root.GridsterCollision = factory(root.$ || root.jQuery, diff --git a/src/jquery.coords.js b/src/jquery.coords.js index 821b67c8..ff7c0d68 100644 --- a/src/jquery.coords.js +++ b/src/jquery.coords.js @@ -7,11 +7,12 @@ */ ;(function(root, factory) { - - if (typeof define === 'function' && define.amd) { + if (typeof exports === 'object') { + module.exports = factory(require('jquery')); + } else if (typeof define === 'function' && define.amd) { define('gridster-coords', ['jquery'], factory); } else { - root.GridsterCoords = factory(root.$ || root.jQuery); + root.GridsterCoords = factory(root.$ || root.jQuery); } }(this, function($) { diff --git a/src/jquery.draggable.js b/src/jquery.draggable.js index d9b5d988..2822b3b1 100644 --- a/src/jquery.draggable.js +++ b/src/jquery.draggable.js @@ -7,8 +7,9 @@ */ ;(function(root, factory) { - - if (typeof define === 'function' && define.amd) { + if (typeof exports === 'object') { + module.exports = factory(require('jquery')); + } else if (typeof define === 'function' && define.amd) { define('gridster-draggable', ['jquery'], factory); } else { root.GridsterDraggable = factory(root.$ || root.jQuery); diff --git a/src/jquery.gridster.extras.js b/src/jquery.gridster.extras.js index e7ea59f8..6915a848 100644 --- a/src/jquery.gridster.extras.js +++ b/src/jquery.gridster.extras.js @@ -1,6 +1,7 @@ ;(function(root, factory) { - - if (typeof define === 'function' && define.amd) { + if (typeof exports === 'object') { + module.exports = factory(require('jquery'), require('./jquery.gridster.js')); + } else if (typeof define === 'function' && define.amd) { define(['jquery', 'gridster'], factory); } else { root.Gridster = factory(root.$ || root.jQuery, root.Gridster); diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index de7f06d6..c9d5ea82 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -7,8 +7,11 @@ */ ;(function(root, factory) { - - if (typeof define === 'function' && define.amd) { + if (typeof exports === 'object') { + module.exports = factory(require('jquery'), + require('./jquery.draggable.js'), require('./jquery.collision.js'), + require('./utils.js')); + } else if (typeof define === 'function' && define.amd) { define(['jquery', 'gridster-draggable', 'gridster-collision'], factory); } else { root.Gridster = factory(root.$ || root.jQuery, root.GridsterDraggable,