Skip to content

Instantly share code, notes, and snippets.

@atestu
Last active August 29, 2015 13:59
Show Gist options
  • Save atestu/10678400 to your computer and use it in GitHub Desktop.
Save atestu/10678400 to your computer and use it in GitHub Desktop.
Simple LESS Gruntfile.js
'use strict';
module.exports = function (grunt) {
// load all grunt tasks
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
watch: {
// if any .less file changes in directory "public/css/" run the "less"-task.
files: "css/*.less",
tasks: ["less"]
},
// "less"-task configuration
less: {
// production config is also available
development: {
options: {
// Specifies directories to scan for @import directives when parsing.
// Default value is the directory of the source, which is probably what you want.
paths: ["css/"],
},
files: {
// compilation.css : source.less
"css/app.css": "css/app.less"
}
},
},
});
// the default task (running "grunt" in console) is "watch"
grunt.registerTask('default', ['watch']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment