Created
May 26, 2016 04:19
-
-
Save shoo7830/4bceeb0695764b52ee4da38e07afc92d 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