Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Connect middleware for LESS CSS

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Cakefile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
README.md

Introduction

connect-lesscss is Connect middleware that compiles LESS to CSS. Since express is built on top of Connect, connect-lesscss will allow you to compile LESS with expressjs.

Installation

npm install connect-lesscss

Usage

Example using express:

less = require('connect-lesscss')
app = require('express').createServer()

app.use("/main.css", less("path/to/main.less", {
  paths: ["path/to/other/less/files"]
}));

app.listen(80);

The middleware builder takes two arguments source and options

  • source: The path to the main .less file to compile
  • options: Object of options with the following keys
    • paths: Array of paths to .less files for @imports

If options.paths is not defined, it will default to the directory containing the source file (path.dirname(source)).

Running Tests

Install development dependencies npm --dev install

Run Tests

cake test

To build js from coffee

cake build

To build and run tests

cake build test
Something went wrong with that request. Please try again.