tschaub / grunt-newer

Configure Grunt tasks to run with newer files only.
https://npmjs.org/package/grunt-newer
MIT License
945 stars 61 forks source link

How to configure the task to check just the saved file? #79

Closed danielmariz closed 9 years ago

danielmariz commented 9 years ago

My task is running all files every time I save a ts file, I'd like to run just saved file

 watch: {
      ts: {
        files: ['app/**/*.ts'],
        tasks: ['newer:tslint:all','newer:ts:default'],
        options: {
          spawn: false
        }
      },
 ...
 }

 // Typescript settings for grunt-ts
    ts: {
      default: {
        src: ['app/scripts/app.ts', '!node_modules/**/*.ts'],
        option: {
          target: 'es5',
          fast: 'never',
          sourceMap: true,
          module: 'amd'
        }
      },
      build: {
        src: ['app/scripts/app.ts', '!node_modules/**/*.ts'],
        out: "app/roamdash2.js",
        options: {
          target: "es5",  
            sourceMap: false,
            module: "amd"
        }
      }
    },

    //definitelytyped tsd settings for grunt-tsd
    tsd: {
      refresh: {
        options: {
          //execute a command
          command: 'reinstall',
          //optional: always get from HEAD
          latest: true,
          //specify config file
          config: 'tsd.json'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes    
    tslint: {
        options: {
            configuration: grunt.file.readJSON("tslint.json")
        },
        all: {
            src: ["app/scripts/**/*.ts", "!node_modules/**/*.ts", "!obj/**/*.ts", "!typings/**/*.ts"] 
            // avoid linting typings files and node_modules files
        }
    },

the ts task, run correctly compiling just the js file, but tslint check all files.

danielmariz commented 9 years ago

Sorry, wrong project, it should be posted on tslint project :/