Skip to content

Commit 6367996

Browse files
committed
Add Grunt Watch task
1 parent 45dbb35 commit 6367996

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Gruntfile.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,21 @@ module.exports = function(grunt) {
4141
src: ['dist/jquery.github.js'],
4242
dest: 'dist/jquery.github.min.js'
4343
}
44-
}
44+
},
45+
46+
// Run JSHint, concat, minify and send it to the dist folder
47+
// any time a file is added, changed or deleted
48+
watch: {
49+
files: ['**/*'],
50+
tasks: ['jshint', 'concat', 'uglify'],
51+
},
4552

4653
});
4754

4855
grunt.loadNpmTasks('grunt-contrib-concat');
4956
grunt.loadNpmTasks('grunt-contrib-jshint');
5057
grunt.loadNpmTasks('grunt-contrib-uglify');
58+
grunt.loadNpmTasks('grunt-contrib-watch');
5159

5260
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
5361
grunt.registerTask('travis', ['jshint']);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
"description": "A jQuery plugin to display your Github Repositories.",
55
"author": "Zeno Rocha",
66
"homepage": "https://github.com/zenorocha/jquery-github/",
7-
"version": "0.2.9",
7+
"version": "0.3.0",
88
"devDependencies": {
99
"grunt": "~0.4.1",
1010
"grunt-cli": "~0.1.7",
1111
"grunt-contrib-jshint": "~0.4.3",
1212
"grunt-contrib-concat": "~0.3.0",
13-
"grunt-contrib-uglify": "~0.2.0"
13+
"grunt-contrib-uglify": "~0.2.0",
14+
"grunt-contrib-watch": "~0.4.2"
1415
},
1516
"scripts": {
1617
"test": "grunt travis --verbose"

0 commit comments

Comments
 (0)