Skip to content

Instantly share code, notes, and snippets.

@juice49
Created March 27, 2012 15:10
Show Gist options
  • Save juice49/2216739 to your computer and use it in GitHub Desktop.
Save juice49/2216739 to your computer and use it in GitHub Desktop.
Recompiles CSS files when source stylus files are saved
var
fs = require('fs'),
exec = require('child_process').exec,
stylus = require('stylus');
var generateCSS = function() {
exec('stylus ./ --out ../../css/ --use nib/lib/nib', function(err, stdout, stderr) {
if(err) {
console.log(err);
}
if(stdout) {
console.log(stdout);
}
if(stderr) {
console.log(stderr);
}
});
}
fs.watch('./', generateCSS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment