diff --git a/Gruntfile.js b/Gruntfile.js index ecadc79..ef4dd32 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,12 +27,20 @@ module.exports = function (grunt) { 'public/css/main.css': 'public/less/main.less' } } + }, + + watch: { + less: { + files: ['public/less/**/*.less'], + tasks: ['less'] + } } }); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-less'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('lint', ['jshint']); grunt.registerTask('compile', ['less']); diff --git a/README.md b/README.md index be6d401..92c73b4 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Now you'll be able to run the following commands: $ grunt # Run the lint and test tasks together $ grunt lint # Run JSHint with the correct config $ grunt compile # Compile front-end assets +$ grunt watch # Watch for file changes and compile assets ``` Code with lint errors or failing tests will not be accepted, please use the build tools outlined above. diff --git a/package.json b/package.json index f1a94ba..ad5e5cb 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "grunt": "~0.4", "grunt-contrib-jshint": "~0.7", "grunt-contrib-less": "~0.8", + "grunt-contrib-watch": "~0.5", "supervisor": "~0.5" },