added less compilation via watch, and a task which will build the less and jade, start the server, then watch for changes

This commit is contained in:
Spencer Alger 2014-02-24 15:47:09 -07:00
parent 193f4f999f
commit a3fcbbd21d
7 changed files with 29 additions and 8 deletions

View file

@ -16,7 +16,8 @@
"mocha": "~1.17.1",
"less-middleware": "~0.1.15",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jade": "~0.10.0"
"grunt-contrib-jade": "~0.10.0",
"grunt-contrib-less": "~0.9.0"
},
"scripts": {
"test": "grunt test",

View file

@ -1,4 +1,4 @@
#examples ng-include {
display: block;
margin: 10px;
}
}

View file

@ -1,6 +1,6 @@
@import '../../bower_components/bootstrap/less/bootstrap.less';
@import '../../bower_components/bootstrap/less/theme.less';
@import "../../bower_components/bootstrap/less/bootstrap.less";
@import "../../bower_components/bootstrap/less/theme.less";
body {
margin: 25px;
}
}

13
tasks/config/less.js Normal file
View file

@ -0,0 +1,13 @@
module.exports = {
src: {
src: [
'<%= app %>/styles/**/*.less',
'<%= app %>/apps/**/*.less'
],
expand: true,
ext: '.css',
options: {
ieCompat: false
}
}
};

View file

@ -3,6 +3,10 @@ module.exports = function (grunt) {
test: {
files: ['<%= unitTestDir %>/*.jade', '<%= unitTestDir %>/**/*.js'],
tasks: ['jade:test', 'mocha:unit']
},
src: {
files: ['<%= src %>'],
tasks: ['less']
}
}
};
};

View file

@ -1,4 +1,4 @@
// Lint and build CSS
module.exports = function(grunt) {
grunt.registerTask('default', ['jshint:source','test']);
module.exports = function (grunt) {
grunt.registerTask('default', ['jshint:source', 'test']);
};

3
tasks/dev.js Normal file
View file

@ -0,0 +1,3 @@
module.exports = function (grunt) {
grunt.registerTask('dev', ['less', 'jade', 'connect:dev', 'watch']);
};