title: Grunt: How to run task only for modified file?
body: <p>I have the following gruntfile.js:</p>
  
  <pre><code>module.exports = function(grunt) {
    require('jit-grunt')(grunt);
  
    grunt.initConfig({
      uglify: {
        options: {
          manage: false
        },
        my_target: {
          files: [{
            expand: true,
            cwd: 'assets/js',
            src: '*.js',
            dest: 'min' 
          }]
        },
      },
      less: {
        development: {
          options: {
            compress: true,
            yuicompress: true,
            optimization: 2
          },
          files: {
            "assets/css/styles.css": "assets/less/styles.less" // destination file and source file
          }
        }
      },
      watch: {
        styles: {
          files: ['assets/less/**/*.less', 'assets/js/*.js'], // which files to watch
          tasks: ['less', 'uglify'],
          options: {
            nospawn: true
          }
        }
  
      }
    });
  
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-newer');
    grunt.registerTask('default', ['less', 'watch', 'newer:uglify']);
  };
  </code></pre>
  
  <p>Everything is running fine, but for JS files it's generating the minified version even if the file is not changed. </p>
  
  <p>For example, if I have <code>script1.js</code>, <code>script2.js</code> and <code>script3.js</code>, but only made changes on script1.js - all others will be also generated.</p>
  
  <p>Is there any way to apply the uglify task only if the file has changed? I tried to use <code>grunt-newer</code> but for some reason is not working.</p>