Commit 936d4939 authored by Julien Fastré's avatar Julien Fastré

add watch task to gruntfile

parent 3bae9bcf
......@@ -11,6 +11,7 @@ module.exports = function(grunt) {
'less': '<%= website.folders.src %>/less'
}
},
bower: {
install: {
options: {
......@@ -22,8 +23,8 @@ module.exports = function(grunt) {
}
}
},
less: {
less: {
options: {
strictMath: true,
sourceMap: true,
......@@ -35,6 +36,7 @@ module.exports = function(grunt) {
'<%= website.folders.web %>/css/chill.social.css': '<%= website.folders.less %>/index.less'
},
bootlint: {
options: {
stoponerror: false,
......@@ -42,6 +44,7 @@ module.exports = function(grunt) {
},
files: ['<%= website.folders.web %>/*.html']
},
copy: {
css: {
files: [
......@@ -50,12 +53,14 @@ module.exports = function(grunt) {
{cwd: '<%= website.folders.bower %>/font-awesome/fonts/', src: '*', dest: '<%= website.folders.web %>/fonts', expand: true}
]
},
img: {
files: [
{expand: true, src: ['**'], cwd: '<%= website.folders.src %>/img', dest: '<%= website.folders.web %>/img'}
]
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
......@@ -69,6 +74,11 @@ module.exports = function(grunt) {
]
}
}
},
watch: {
files: ['<%= website.folders.less %>/*.less'],
tasks: ['less']
}
});
......@@ -77,6 +87,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['uglify', 'bootlint', 'less']);
grunt.registerTask('install', ['bower', 'uglify', 'copy:img', 'copy:css']);
......
......@@ -11,7 +11,8 @@
"grunt-bower-task": "^0.4.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-uglify": "^0.9.1"
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment