From e83381e1aa43c0f3097d36fe2c65e170aac82ef4 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 22 Apr 2016 11:33:21 -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..b80c131 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') +}