How to compile main.less when I save other.less using gruntfile.js

I have several .less files for my site, and the main one imports the others. I've come across the situation where I make changes in the other.less file which grunt will compile, but it won't compile the main.less file which is the only one that I need.

I don't know how to configure my gruntfile.js so that it will compile the main.less file whenever it detects changes in the root folder but leave the other .less files uncompiled.

Any help would be appreciated!

Upvotes: 1

Views: 46

Answers (1)

alexreardon
alexreardon

Reputation: 636

Create a grunt watch (https://github.com/gruntjs/grunt-contrib-watch) job which watches all of your less files. When anything changes, run your less job that compiles your main.less file

Upvotes: 2

Related Questions