Skip to content

Instantly share code, notes, and snippets.

@jdewit
Last active December 14, 2015 09:38
Show Gist options
  • Save jdewit/5066131 to your computer and use it in GitHub Desktop.
Save jdewit/5066131 to your computer and use it in GitHub Desktop.
Gruntfile.js
'use_strict';
var path = require('path'),
lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet,
folderMount = function folderMount(connect, point) {
return connect.static(path.resolve(point));
};
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
uses_defaults: {}
},
livereload: {
options: {
middleware: function(connect, options) {
return [lrSnippet, folderMount(connect, '.')]
}
}
},
recess: {
dist: {
options: {
compile: true
},
files: {
'web/css/style.css': [
'web/less/dev/bootstrap.less'
]
}
},
regarde: {
less: {
files: 'web/less/dev/*.less',
tasks: ['recess', 'livereload']
}
});
grunt.loadNpmTasks('grunt-contrib-livereload');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-regarde');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', ['livereload-start', 'connect', 'regarde']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment