2

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

Im using this on my simple HTML/CSS project. pure frontend. its not a Ruby or nodejs project.

And when I do

lessc styles.less styles.css -x -w

in terminal, it compiles and compresses the code, but doesn't watch the file for changes, since Im expecting LESS to auto compile and refresh the page automatically. So, if I do any changes in my styles.less, every-time I have to go to terminal and enter the command to compile the less css.

Also, the compiler does NOT even show any compile errors even if I add anything on purpose, but in that case it doesn't compiles.

Please guide me on how to achieve the above. This is my first day with LESS CSS.

0

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for replying. But is there anything for ubuntu like this one wearekiss.com/simpless
You can use npmjs.org/package/watch-lessc which wraps watch. I am not really aware of any GUI for building it, I stick to the console, so I am OS independent. I think you can download simpleLess and build it on your own.
1

I did this with help of @Oil on ubuntu forums.

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

  1. then simply CD to the css folder. and run below lines together:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.