Connect Middleware for LESS.js compiling
JavaScript
Pull request Compare This branch is 215 commits behind emberfeather:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
package.json
readme.md

readme.md

Installation

sudo npm install less-middleware

Options

Option Description Default
force Always re-compile less files on each request. false
once Only check for need to recompile once after each server restart. Useful for reducing disk i/o on production. false
debug Output any debugging messages to the console. false
src Source directory containing the .less files. Required.
dest Desitnation directory to output the compiled .css files. <src>
compress Compress the output being written to the *.css files. When set to 'auto' compression will only happen when the css file ends with .min.css or -min.css. auto
optimization Desired level of LESS optimization. Optionally 0, 1, or 2 0

Examples

Connect

var lessMiddleware = require('less-middleware');

var server = connect.createServer(
    lessMiddleware({
        src: __dirname + '/public',
        compress: true
    }),
    connect.staticProvider(__dirname + '/public')
);

Express

var lessMiddleware = require('less-middleware');

var app = express.createServer();

app.configure(function () {
    // Other configuration here...

    app.use(lessMiddleware({
        src: __dirname + '/public',
        compress: true
    }));

    app.use(express.static(__dirname + '/public'));
});