Coder Social home page Coder Social logo

lews's Introduction

Lews

Little Lews compiles all your Less files and and keeps track of their @imports

Why you need it

You, Lenny, have these Less files with the following imports:

bundle.less
\_ fonts.less
|  \_ icons.less
|_ buttons.less
|  \_ helpers.less
|_ helpers.less

Say you edit helpers.less, Lews will compile helpers.less, buttons.less and bundle.less. Should you edit icons.less, Lews will compile icons.less, fonts.less and bundle.less.

Pretty neat, right?

Features

  • Compiles all Less files that imports the changed Less file recursively
  • Gulp-support
  • Experimental socket-support - compiles filename sent through a socket. This is useful when working over NFS.

Usage examples

Cli:

Usage: lews [options] sourcePath [destPath]
    --no-source-map: dont inline source maps
    --use-socket [socketPath]: listen on socket for files to compile
    --no-watch: don't watch for file changes
    --watch-interval interval: specify watch interval
    --help / --usage: this help message

Gulp:

var gulp = require('gulp'),
    Lews = require('lews');

gulp.task('dev', function() {
    var lews = new Lews('css', 'public/css');
    gulp.watch(['css/**/*.less'], lews.gulpWatchCb.bind(lews));
});

With sockets and Vim: (useful then working over NFS)

lews --use-socket /srv/www/testsite/lews.sock --watch-interval 3000 /srv/www/testsite/css /srv/www/testsite/public/css
autocmd BufWritePost /srv/www/testsite/css/*.less silent !echo -ne '<afile>:p' | nc -U /srv/www/testsite/lews.sock

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.