Wondering what’s next for npm?Check out our public roadmap! »

    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

    36

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar