Bundle all of your LESS files into a single file. Useful for large projects with multiple components utilizing their own LESS files.
const path = require('path');
const LessBundle = require('less-bundle-promise');
new LessBundle().compressor({
src: 'main.less'
}).then(output =>{
}).catch(error => {
console.log('Error', error);
});
new LessBundle().compressor({
src: 'main.less',
dest: 'bundle.less',
writeFile: true
}).then(output =>{
}).catch(error => {
console.log('Error', error);
});
new LessBundle().compressor({
src: 'main.less',
dest: 'bundle.less',
writeFile: true,
nodeModulesPath: path.join(__dirname, './node_modules');
}).then(output =>{
}).catch(error => {
console.log('Error', error);
});
A `bundle.less` file will be generated with all less output