Skip to content

Commit

Permalink
Add watch task to grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
roadsideseb committed Jul 17, 2014
1 parent 4866337 commit 905e943
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
27 changes: 23 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ module.exports = function(grunt) {
"fancypages/static/fancypages/dist/libs/rangeslider/rangeslider.min.js": [
"fancypages/static/fancypages/src/libs/rangeslider/rangeslider.min.js"
],
"fancypages/static/fancypages/dist/libs/wysihtml5/wysihtml5-0.3.0.min.js": [
"fancypages/static/fancypages/src/libs/wysihtml5/wysihtml5-config.js",
"fancypages/static/fancypages/src/libs/wysihtml5/wysihtml5-0.3.0.js"
],
"fancypages/static/fancypages/dist/js/fancypages.min.js": [
"fancypages/static/fancypages/src/js/app.js",
"fancypages/static/fancypages/src/js/api.js",
Expand All @@ -69,11 +65,34 @@ module.exports = function(grunt) {
},
src: ['tests/javascript/**/*.html'],
},
},

watch: {
options: {
livereload: true,
atBegin: true
},
javascript: {
files: [
'fancypages/static/fancypages/src/js/**/*.js',
'fancypages/templates/**/*.jst',
'fancypages/templates/**/*.html',
],
tasks: ['uglify']
},
styles: {
files: [
'fancypages/static/fancypages/src/less/**/*.less',
'fancypages/templates/**/*.html',
],
tasks: ['less', 'cssmin']
}
}
});

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"grunt-mocha": "~0.4.10",
"grunt-contrib-less": "~0.11.0",
"grunt-contrib-uglify": "~0.5.0",
"grunt-contrib-cssmin": "~0.10.0"
"grunt-contrib-cssmin": "~0.10.0",
"grunt-contrib-watch": "~0.6.1"
},
"devDependencies": {},
"scripts": {
Expand Down

0 comments on commit 905e943

Please sign in to comment.