brackets-less-autocompile icon indicating copy to clipboard operation
brackets-less-autocompile copied to clipboard

Automatically determine which files to compile

Open blackmambahk opened this issue 10 years ago • 2 comments

I have a file "variables.less" that is imported into every other less file in my project.

If I edit variables.less in Brackets only variables.less gets recompiled all the other files are untouched.

However if I am running this in WebStorm I have setup a file watcher that gets called when a file changes and executes the less compiler from the command line passing it the name of the file that changed (variables) and it works out that it needs to recompile all the less files in the project.

Is there some setting to get the autocompile to recompile all effected files not just the one being edited, if not really need this feature.

blackmambahk avatar Oct 12 '14 20:10 blackmambahk

There is no automatic way of determining, which file needs to be compiles. However, you can achieve the same results with just a little bit of manual work. There are two alternatives to specify which files to compile:

  1. Specify your LESS entry point for the project using Project-Wide Compile Settings
  2. Specify a different file to comple via the main directive in the options header

jdiehl avatar Oct 13 '14 15:10 jdiehl

Well I read the two sections you point to and I don't think either of those suggestions works in this case.

First I don't want to compile another file instead of the current one (main directive in the options header), and I don't want to always compile a specific set of files (Project-Wide Compile Settings).

generally when I change file B I want B to compile

but when I change A I want the extension to figure out that B,C,D,E and G are dependent on A and recompile them.

There is a node plugin called autoless that does exactly that,

blackmambahk avatar Oct 13 '14 16:10 blackmambahk