diff --git a/tasks/uncss.js b/tasks/uncss.js index 1717f46..62d1180 100644 --- a/tasks/uncss.js +++ b/tasks/uncss.js @@ -26,13 +26,17 @@ module.exports = function ( grunt ) { var src = f.src.filter(function ( filepath ) { // Warn on and remove invalid source files (if nonull was set). if ( !grunt.file.exists( filepath ) ) { - grunt.log.warn( 'Source file "' + filepath + '" not found.' ); + grunt.log.warn( 'Source file ' + chalk.cyan( filepath ) + ' not found.' ); return false; } else { return true; } }); + if ( src.length === 0 ) { + grunt.fail.warn( 'Destination (' + f.dest + ') not written because src files were empty.' ); + } + f.orig.src.forEach(function (source) { if (/^https?/.test(source)) { src.push(source); @@ -40,11 +44,6 @@ module.exports = function ( grunt ) { } }); - if ( src.length === 0 ) { - grunt.log.warn( 'Destination (' + f.dest + ') not written because src files were empty.' ); - return; - } - try { uncss( src, options, function ( error, output, report ) { if ( error ) {