-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.json
executable file
·55 lines (55 loc) · 6.24 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"name": "grunt-newer",
"description": "Run Grunt tasks with only those source files modified since the last successful run.",
"version": "0.5.4",
"homepage": "https://github.com/tschaub/grunt-newer",
"author": {
"name": "Tim Schaub",
"url": "http://tschaub.net/"
},
"repository": {
"type": "git",
"url": "git://github.com/tschaub/grunt-newer.git"
},
"bugs": {
"url": "https://github.com/tschaub/grunt-newer/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://tschaub.mit-license.org/"
}
],
"main": "gruntfile.js",
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "grunt test",
"start": "grunt watch"
},
"devDependencies": {
"grunt": "0.4.1",
"grunt-cli": "0.1.9",
"grunt-contrib-watch": "0.5.3",
"grunt-contrib-jshint": "0.6.4",
"chai": "1.7.2",
"grunt-cafe-mocha": "0.1.8",
"wrench": "1.5.1",
"tmp": "0.0.21",
"grunt-contrib-clean": "0.5.0"
},
"peerDependencies": {
"grunt": "~0.4.1"
},
"keywords": [
"gruntplugin",
"grunt",
"newer",
"files"
],
"readme": "# grunt-newer\n\nConfigure [Grunt](http://gruntjs.com/) tasks to run with only those files modified since the last successful run.\n\n## Getting Started\nThis plugin requires Grunt `~0.4.1`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [`gruntfile.js`](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-newer --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your `gruntfile.js` with this line:\n\n```js\ngrunt.loadNpmTasks('grunt-newer');\n```\n\n## The `newer` task\n\nThe `newer` task doesn't require any special configuration. To use it, just add `newer` as the first argument when running other tasks.\n\nFor example, if you want to run [JSHint](https://npmjs.org/package/grunt-contrib-jshint) on only those files that have been modified since the last successful run, configure the `jshint` task as you would otherwise, and then register a task with `newer` at the front.\n\n```js\n grunt.initConfig({\n jshint: {\n options: {\n jshintrc: '.jshintrc'\n },\n all: {\n src: 'src/**/*.js'\n }\n }\n });\n\n grunt.loadNpmTasks('grunt-contrib-jshint');\n grunt.loadNpmTasks('grunt-newer');\n\n grunt.registerTask('lint', ['newer:jshint:all']);\n```\n\nWith the above configuration, running `grunt lint` will configure your `jshint:all` task to use only files in the `src` config that have been modified since the last successful run of the same task.\n\nAnother example is to use the `newer` task in conjunction with `watch`. For example, you might want to set up a watch to run a linter on all your `.js` files whenever any of them changes. With the `newer` task, instead of re-running the linter on all files, you only need to run it on the files that changed.\n\n```js\n var srcFiles = 'src/**/*.js';\n\n grunt.initConfig({\n jshint: {\n all: {\n src: srcFiles\n }\n },\n watch: {\n all: {\n files: srcFiles,\n tasks: ['newer:jshint:all']\n }\n }\n });\n\n grunt.loadNpmTasks('grunt-contrib-jshint');\n grunt.loadNpmTasks('grunt-contrib-watch');\n grunt.loadNpmTasks('grunt-newer');\n\n```\n\nWith the above configuration, running `grunt jshint watch` will first lint all your files with `jshint` and then set up a watch. Whenever one of your source files changes, the `jshint` task will be run on just the modified file.\n\n\n## The `any-newer` task\n\nThe `newer` task described above reconfigures the target task to run with only those files that have been modified since the last run. This works well for tasks that don't generate new files (like linting). When you have a task that generates destination files based on configured source files, you likely want to process all source files if any one of them has been modified since the last run. The `any-newer` task serves this purpose.\n\nFor example, if you want to run [UglifyJS](https://npmjs.org/package/grunt-contrib-uglify) on all your source files only when one or more have been modified since the last run, configure the `uglify` task as you would otherwise, and then register a task with `any-newer` at the front.\n\n\n```js\n grunt.initConfig({\n uglify: {\n all: {\n files: {\n 'dest/app.min.js': 'src/**/*.js'\n }\n }\n }\n });\n\n grunt.loadNpmTasks('grunt-contrib-uglify');\n grunt.loadNpmTasks('grunt-newer');\n\n grunt.registerTask('minify', ['any-newer:uglify:all']);\n```\n\nWith the above configuration, running `grunt minify` will only run the `uglify:all` task if one or more of the configured `src` files have been modified since the last successful run of the same task.\n\n## Options for the `newer` and `any-newer` tasks\n\nIn most cases, you shouldn't need to add any special configuration for the `newer` or `any-newer` tasks. Just `grunt.loadNpmTasks('grunt-newer')` and you can use the tasks. The single option below is available if you need a custom configuration.\n\n#### <a id=\"optionstimestamps\">options.timestamps</a>\n * type: `string`\n * default: `node_modules/grunt-newer/.cache`\n\nTo keep track of timestamps for successful runs, the `newer` and `any-newer` tasks write to a cache directory. The default is to use a `.cache` directory within the `grunt-newer` installation directory. If you need timestamp info to be written to a different location, configure the task with a `timestamps` option.\n\nExample use of the `timestamps` option:\n\n```js\n grunt.initConfig({\n newer: {\n options: {\n timestamps: 'path/to/custom/cache/directory'\n }\n }\n });\n```\n\n## That's it\n\nPlease [submit an issue](https://github.com/tschaub/grunt-newer/issues) if you encounter any trouble. Contributions or suggestions for improvements welcome!\n\n[![Current Status](https://secure.travis-ci.org/tschaub/grunt-newer.png?branch=master)](https://travis-ci.org/tschaub/grunt-newer)\n",
"readmeFilename": "README.md",
"_id": "grunt-newer@0.5.4",
"_from": "grunt-newer@~0.5.4"
}