npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

less-compile-file

1.0.1 • Public • Published

less-compile-file (npm)

npm version

🔨 Compiling LESS file to CSS

Usage

$ npm install less-compile-file
let 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

install

npm i less-compile-file

Downloadsweekly downloads

79

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability