A function that loads a LESS file, transforms it to CSS, adds vendor prefixes and minifies the output.
npm install rosid-handler-less
const handler = require('rosid-handler-less')
handler('main.less').then((data) => {})
handler('main.css', { optimize: true }).then((data) => {})Add the following object to your rosidfile.json, rosidfile.js or routes array. rosid-handler-less will transform all matching LESS files in your source folder to CSS.
{
"name" : "LESS",
"path" : "[^_]*.{css,less}*",
"handler" : "rosid-handler-less"
}/* main.less */
.class {
color: white;
}/* main.css (output) */
.class { color: white; }filePath{String}Absolute path to file.opts{?Object}Options.optimize{?Boolean}- Optimize output. Defaults tofalse.
{Promise<String|Buffer>}The transformed file content.