Skip to content
Snippets Groups Projects
Gruntfile.js 1.42 KiB
'use strict';
 
module.exports = function (grunt) {
    // load all grunt tasks
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    
    grunt.initConfig({
        watch: {
            // if any .less file changes in directory "public/css/" run the "less"-task.
            css: {
                files: "src/less/*.less",
                tasks: ["less", "cssmin"] 
            }
        },
        // "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/resource_scheduler.css": "src/less/resource_scheduler.less"
                }
            },
        },
        cssmin: {
          target: {
            files: [{
              expand: true,
              src: ['public/css/resource_scheduler.css', 'public/css/resource_scheduler.css'],
            }]
          }
        }
    });
     // the default task (running "grunt" in console) is "watch"
     grunt.registerTask('default', ['watch']);
};