From ceec07119cb97923244acf16faa5b5ad6d67c5b8 Mon Sep 17 00:00:00 2001 From: slavic Date: Thu, 10 May 2012 23:20:04 +0300 Subject: [PATCH] exports does not contain console object --- src/htmlminifier.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/htmlminifier.js b/src/htmlminifier.js index ffc178f..c06d6a1 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -395,8 +395,12 @@ log('minified in: ' + (new Date() - t) + 'ms'); return str; } - - // export - global.minify = minify; - -})(typeof exports === 'undefined' ? window : exports); \ No newline at end of file + + // for CommonJS enviroments, export everything + if ( typeof exports !== "undefined" ) { + exports.minify = minify; + } else { + global.minify = minify; + } + +}(this)); \ No newline at end of file -- 2.34.1