alexkwolfe / node-less-compiler

Node.js module that watches a directory of LESS files for changes, and compiles to CSS when a change is made.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Watches a directory of LESS files for changes, and compiles to CSS when a change is made.

Usage

var lessCompiler = require('less-compiler');
var lessPath = '/path/to/less/files';
var cssPath = '/path/to/css/files';

// set up the compiler
var compiler = lessCompiler({
  src: path.join(lessPath, 'style.less'), // the less file with all your imports
  dest: cssPath                           // the directory where all your compiled CSS files go
});
compiler.on('compile', function() {
  console.log("recompiled LESS assets");
});
compiler.on('error', function(err) {
  console.log("could not compile LESS assets: " + err);
});

// watch the parent directory of the src file
compiler.watch(); 

About

Node.js module that watches a directory of LESS files for changes, and compiles to CSS when a change is made.


Languages

Language:JavaScript 100.0%