From 703c64a5b5f4e34353ebac84a8e9e1a8d37765b9 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 22 Apr 2016 11:36:06 -0400 Subject: [PATCH] Fix for avoid build issue for browser verify if the code is to build for nodeJs or for the browser. If the library is built and minified for the browser, the NodeJS code in index.js will not be added because module.exports cannot interpreted by the browser. --- index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 635af81..d4f3a10 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ -module.exports = require('./js/load-image') - -require('./js/load-image-exif') -require('./js/load-image-exif-map') -require('./js/load-image-meta') -require('./js/load-image-orientation') +if (typeof module === 'object' && module.exports) { + module.exports = require('./js/load-image') + require('./js/load-image-exif') + require('./js/load-image-exif-map') + require('./js/load-image-meta') + require('./js/load-image-orientation') +}