@@ -62,7 +62,7 @@ function findJS(searchDir, options = {}) {
6262 } ) ;
6363
6464 // Log/return final result
65- if ( ! options . isRecursing && options . verbose ) {
65+ if ( options . verbose && ! options . isRecursing ) {
6666 console . info ( 'findJS() » Search complete! '
6767 + ( jsFiles . length == 0 ? 'No' : jsFiles . length )
6868 + ` file${ jsFiles . length == 1 ? '' : 's' } found.` ) ;
@@ -106,7 +106,7 @@ function minify(input, options = {}) {
106106 const minifyResult = uglifyJS . minify ( fs . readFileSync ( input , 'utf8' ) , minifyOptions ) ;
107107 if ( options . comment ) minifyResult . code = prependComment ( minifyResult . code , options . comment ) ;
108108 if ( minifyResult . error ) console . error ( `minify() » ERROR: ${ minifyResult . error . message } ` ) ;
109- else if ( typeof window != 'undefined' )
109+ else if ( options . verbose && typeof window != 'undefined' )
110110 console . info ( 'minify() » Minification complete! Check returned object.' ) ;
111111 return { code : minifyResult . code , srcPath : path . resolve ( process . cwd ( ) , input ) ,
112112 error : minifyResult . error } ;
@@ -123,7 +123,7 @@ function minify(input, options = {}) {
123123 return { code : minifyResult . code , srcPath : jsPath , error : minifyResult . error } ;
124124 } ) . filter ( data => ! data . error ) ; // filter out failed minifications
125125 if ( options . verbose ) {
126- if ( minifyResult . length > 0 ) console . info (
126+ if ( minifyResult . length > 0 && typeof window != 'undefined' ) console . info (
127127 'minify() » Minification complete! Check returned object.' ) ;
128128 else console . info (
129129 'minify() » No unminified JavaScript files processed.' ) ;
0 commit comments