Does for languages that can be 'built' what consolidate.js does for templates
npm install consolidate-buildconsolidate-build
=================
Does for languages that can be 'built' what consolidate.js does for templates
(path[, locals], callback) or .render(str[, locals], callback) as shown below.
console.log(build) for the full list of identifiers.
js
var build = require('consolidate-build');
build.less('styles/style.less', { compress: true }, function(err, css){
if (err) throw err;
console.log(css);
});
`
Or without options / local variables:
`js
var build = require('consolidate-build');
build.less('styles/style.less', function(err, css){
if (err) throw err;
console.log(css);
});
`
To dynamically pass the engine, simply use the subscript operator and a variable:
`js
var build = require('consolidate-build')
, name = 'less';
buildname{
if (err) throw err;
console.log(css);
});
`
$3
All the languages support being built without a file being present. To do this ismply use the render method.
`js
build.less('.class { width: 1 + 1 }', { compress: true}, function(err, css){
if (err) throw err;
console.log(css);
});
``