File watchers issues and LESS

Hi there!

I've got a default Bootstrap in developer version. So I edit it's LESS files directly and they are transpiled using node.js LESS module to CSS. LESS file watcher scope is set to check every file in bootstrap's LESS directory ("file:bootstrap-test/less//*").

All seems to compile good, until I edit and save some LESS files, that use mixins from other LESS files and those files are not imported directly in the file I'm editing at the moment. Those dependencies are imported only in root bootstrap.less, so recompiling this core file brings no errors. But on those small component files, node throws an errors like: "NameError: .make-grid-columns is undefined" and compiling process stops.

Question: Can I set IDE to watch those small component files for being modified, but fire to compile only certain core .less files? Bootstrap.less, and theme.less in my case. If I exclude LESS files causing errors from scope, recompile process doesn't even start after resaving.

"LESS CSS Compiler" plugin can be configured to compile only specific files, but it is slow and sometimes don't work.

BTW, components files with no dependencies compiles in my CSS folder too, if I edit and save them. But I don't need them, all of them are already included in bootstrap.css.


Thank you!

Comment actions Permalink

Hi there,

The "Track only root files" option in File Watcher settings does just that -- as long as this individual file is included by some other/master file then that master file will be compiled instead.

Another alternative is to hard code what file to compile -- this way you will always compile your master file regardless of what .less file was changed

Comment actions Permalink

Andriy, thank you so much!

I thought that "root files" are some kind of root folder in the scope or folders hierarchy. Quick test proves your idea works just fine!


Please sign in to leave a comment.