less-compile-file
v1.0.7
Published
🔨 Compiling LESS file to CSS
Downloads
186
Maintainers
Readme
less-compile-file
🔨 Compiling LESS file to CSS
Usage
npm install less-compile-file
const compiler = require('less-compile-file');
compiler('file.less', 'file.css')
.catch((err) => {
console.error(err);
})
.then((results) => {
console.log('Compiling completed.');
console.log(results.source);
console.log(results.destination);
console.log(results.code);
});
History
I use less-compiler
package
for compiling LESS file, but I have an error:
node_modules/less/lib/less/parser/parser.js:117
imports.contents[fileInfo.filename] = str;
^
TypeError: Cannot read property 'contents' of undefined
at Object.parse (node_modules/less/lib/less/parser/parser.js:117:20)
at Object.fromSource (node_modules/less-compiler/less-compiler.js:36:19)
at node_modules/less-compiler/less-compiler.js:53:23
at tryToString (fs.js:426:3)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:413:12)
Development
npm install
npm test
Try run file (which compile CSS files) with debug flag in example:
DEBUG=* node style-compiler.js
License
The MIT License @ 2017