Skip to content

Commit

Permalink
added less compilation via watch, and a task which will build the les…
Browse files Browse the repository at this point in the history
…s and jade, start the server, then watch for changes
  • Loading branch information
Spencer Alger committed Feb 24, 2014
1 parent 193f4f9 commit a3fcbbd
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 8 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/kibana/apps/examples/styles/index.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#examples ng-include {
display: block;
margin: 10px;
}
}
6 changes: 3 additions & 3 deletions src/kibana/styles/main.less
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions tasks/config/less.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
src: {
src: [
'<%= app %>/styles/**/*.less',
'<%= app %>/apps/**/*.less'
],
expand: true,
ext: '.css',
options: {
ieCompat: false
}
}
};
6 changes: 5 additions & 1 deletion tasks/config/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ module.exports = function (grunt) {
test: {
files: ['<%= unitTestDir %>/*.jade', '<%= unitTestDir %>/**/*.js'],
tasks: ['jade:test', 'mocha:unit']
},
src: {
files: ['<%= src %>'],
tasks: ['less']
}
}
};
};
4 changes: 2 additions & 2 deletions tasks/default.js
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 0 deletions tasks/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function (grunt) {
grunt.registerTask('dev', ['less', 'jade', 'connect:dev', 'watch']);
};

0 comments on commit a3fcbbd

Please sign in to comment.