Node.js module that watches a directory of LESS files for changes, and compiles to CSS when a change is made.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
node_modules
index.js
package.json
readme.md

readme.md

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();