From 8c63d30ab0cbe8dc2d843093470047a2ef457db5 Mon Sep 17 00:00:00 2001 From: Olivier Pichon Date: Tue, 23 Jun 2015 11:22:06 +1000 Subject: [PATCH] Make sure we are in Node land before to require leaflet. Some nasty library like angular-mock include 'module' in the window: `window.module = angular.mock.module` --- src/L.Control.Zoomslider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/L.Control.Zoomslider.js b/src/L.Control.Zoomslider.js index 606cd1d..0293389 100644 --- a/src/L.Control.Zoomslider.js +++ b/src/L.Control.Zoomslider.js @@ -4,7 +4,7 @@ if (typeof define === 'function' && define.amd) { // AMD define(['leaflet'], factory); - } else if (typeof module !== 'undefined') { + } else if (typeof module !== 'undefined' && module && module.exports) { // Node/CommonJS L = require('leaflet'); module.exports = factory(L);