diff --git a/daterangepicker.js b/daterangepicker.js index 78ac9f3a..dc9f2b25 100644 --- a/daterangepicker.js +++ b/daterangepicker.js @@ -15,12 +15,13 @@ } else if (typeof exports !== 'undefined') { var momentjs = require('moment'); - var jQuery; - try { - jQuery = require('jquery'); - } catch (err) { - jQuery = window.jQuery; - if (!jQuery) throw new Error('jQuery dependnecy not found'); + var jQuery = window.jQuery; + if (jQuery === undefined) { + try { + jQuery = require('jquery'); + } catch (err) { + if (!jQuery) throw new Error('jQuery dependency not found'); + } } factory(root, exports, momentjs, jQuery);