gruntjslessgrunt-contrib-watchgrunt-usemin

How to create multiple minified css files for multiple less files using grunt?


I have 5 less files. I want to convert this 5 less files into 5 diffrent css minified files using grunt .

https://scotch.io/tutorials/a-simple-guide-to-getting-started-with-grunt

By this tutorial I get to know that the converting multiple less files to single css file. But I want convert multiple to multiple

less: {
  build: {
    files: {
      'Aline-production/css/pretty.css': 'Aline-dev/css/*.less'
    }
  }
}

Is there any way. Please any one can help me to do that


Solution

  • I use grunt-sass but i imagine the following should work.

    less: {
      build: {
        files: [
            {
                expand: true,
                cwd: 'Aline-dev/css/',
                src: ['*.less'],
                dest: 'Aline-production/css/',
                ext: '.css'
            }
        ]
      }
    }