I have installed node, and npm. With npm I downloaded less.
And when I do
lessc styles.less styles.css -x -w
in terminal, it compiles and compresses the code, but doesnt 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.
Please guide me on how to achieve the above. This is my first day with LESS CSS.
Best Answer
Simply put, the
-w
argument doesn't exist.However, you can use inotify to watch for changes and this accomplishes roughly what you want:
2019 update: While
lessc
is something I still do use directly, occasionally, I tend to lean towards a full webpack stack these days.It's not quite as soul destroying as it appears from afar, but it can take some time (and trust) to get set up. Especially if you have preconceptions about how this stuff should work.
And yes, I'm sure by Summer 2019 webpack will be a dead project and all the client-side-hipsters will have moved onto something else. That's just the risk here. The good thing is that ultimately this is a layer on top of things like LESS and SASS and various scripting languages, and it's all client side. So you can continue to be a dinosaur for as long as you like.