Skip to content

Instantly share code, notes, and snippets.

@imlucas
Created March 15, 2016 18:40
Show Gist options
  • Save imlucas/294d291183d8b275ded9 to your computer and use it in GitHub Desktop.
Save imlucas/294d291183d8b275ded9 to your computer and use it in GitHub Desktop.
var LessCache = require('less-cache');
var dest = path.join(CONFIG.resources, 'app', 'less-compile-cache');
var src = path.join(CONFIG.resources, 'app', 'index.less');
var lessCache = new LessCache({
cacheDir: dest,
resourcePath: path.join(CONFIG.resources, 'app'),
importPaths: []
});
fs.readFile(src, 'utf-8', function(err, contents) {
if (err) {
return done(err);
}
lessCache.cssForFile(src, contents);
done();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment