simple-less-middleware
A minimal LESS middleware for server requests.
When the given CSS URL is requested, the server responds with the result of LESS transpilation.
Install
npm install simple-less-middleware --save
Example
var lessMiddleware = // path to the LESS entry pointvar file = '/path/to/style.less' // what the <link href> will requestvar url = 'style.css' var less = var server = http server
Usage
fn = middleware (lessFile, cssUrl, [opts])
Creates a new fn(req, res, next)
function with lessFile
(path to LESS entry point) and cssUrl
(the URL pathname to respond to the request on).
Options:
compress
Boolean, default falseautoprefix
Array or comma-separated String list of browsers, default no autoprefixingpaths
Array of paths to provide to LESSrender()
License
MIT, see LICENSE.md for details.