Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
[deprecated] Grunt plugin for LESS.
JavaScript
Tree: 465eb5f89e

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
tasks
test
.gitignore
.lvimrc
.npmignore
LICENSE-MIT
README.md
grunt.js
package.json

README.md

grunt-less

LESS task for grunt.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-less

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-less');

Documentation

This task is a multi task, meaning that grunt will automatically iterate over all less targets if a target is not specified.

Target Properties

  • src(required): The LESS file(s) to be compiled. Can be either a string or an array of strings. If more than one LESS file is provided, each LESS file will be compiled individually and then concatenated together.
  • dest(required): The path where the output from the LESS compilation should be placed. Must be a string as there can be only one destination.
  • options(optional): An object of LESS options. As of right now, the only options supported are compress and yuicompress.

Example

// project configuration
grunt.initConfig({
    less: {
        signup: {
            src: 'signup.less',
            dest: 'signup.css'
        },
        homepage: {
            src: ['banner.less', 'app.less'],
            dest: 'homepage.css',
            options: {
                yuicompress: true
            }
        }
        all: {
            src: '*.less',
            dest: 'all.css',
            options: {
                compress: true
            }
        }

    }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

  • 04/08/2012 - 0.1.4: Refactored the code to make the helper function more usable.
  • 04/08/2012 - 0.1.3: Added gruntplugin keyword to be consistent with other plugins.
  • 04/05/2012 - 0.1.2: Added support for wildcard patterns and normalizing linefeeds for concatenation.
  • 04/04/2012 - 0.1.1: Checking to see if the src and dest properties are defined. Also now accept a string for src and not just an array of strings.
  • 04/04/2012 - 0.1.0: Initial release.

License

Copyright (c) 2012 Jake Harding
Licensed under the MIT license.

Something went wrong with that request. Please try again.