LESS css compiler help in terminal

Im using Ubuntu 13.04 (Linux) I installed node and npm. With npm, I downloaded less through the terminal.

I use this in my simple HTML / CSS project. clean interface. This is not a Ruby or nodejs project.

And when I do

lessc styles.less styles.css -x -w 

in the terminal, it compiles and compresses the code, but does not look at the file for changes, since Im expects LESS to automatically compile and refresh the page automatically. So, if I make any changes to my styles., Each time I have to go to the terminal and enter a command to compile less CSS.

In addition, the compiler does not even show any compilation errors , even if I specifically add something, but in this case it does not compile.

Please tell us how to do this. This is my first day with LESS CSS.

+2
linux css less compiler-errors
Sep 25 '13 at 11:11
source share
2 answers

If you type lessc help , you will see that there is no argument -w or -watch. What you can do is use a build system such as GruntJS with an extension like grunt-contrib-watch , and you have a monitor for smaller files and css build on change.

+2
Sep 25 '13 at 11:20
source share

I did this using @Oil on the ubuntu forums.

In the terminal, 1. install sudo apt-get install inotify-tools

  • and then just cd to the css folder. and run below the lines together:

    while inotifywait -r styles.less; do lessc -x styles.less styles.css; done

+1
Sep 26 '13 at 5:03 on
source share



All Articles