From 3be2105a93dffc38b70b3d998a086cc234f7678b Mon Sep 17 00:00:00 2001 From: Chaoyu Date: Fri, 9 Oct 2015 15:22:00 -0700 Subject: [PATCH] try load lodash, otherwise use global _ --- src/gridstack.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gridstack.js b/src/gridstack.js index 82267aa..afd7843 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -10,7 +10,8 @@ } else if (typeof exports !== 'undefined') { try { jQuery = require('jquery'); } catch(e) {} - factory(jQuery, require("lodash")); + try { _ = require('lodash'); } catch(e) {} + factory(jQuery, _); } else { factory(jQuery, _);