From: slavic Date: Thu, 10 May 2012 20:20:04 +0000 (+0300) Subject: exports does not contain console object X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=ceec07119cb97923244acf16faa5b5ad6d67c5b8;p=html-minifier.git exports does not contain console object --- 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