Created
May 5, 2016 15:10
-
-
Save squalltua/0f4db30d874f4c56d3bbbb3bc071209d to your computer and use it in GitHub Desktop.
sample Gruntfile.js for watching and compiling less files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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: "public/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: ["public/css/"], | |
}, | |
files: { | |
// compilation.css : source.less | |
"public/css/app.css": "public/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