brunch / less-brunch

Adds LESS support to Brunch
14 stars 18 forks source link

Watched files collects all `app/*.less` files regardless of joinTo file patterns. #30

Closed chamberlainpi closed 8 years ago

chamberlainpi commented 8 years ago

It looks like, even when you specify joinTo output files containing RegExp patterns that should filter-out certain files / folders containing *.less, the compiler finds and outputs warnings about them anyways.

Example:

files: {
   javascripts: {
     joinTo: {
       "js/app1.js" : /^app\/app1\/[a-z0-9_\-\/]\.js/i,
       //"js/app2.js" : /^app\/app2\/[a-z0-9_\-\/]\.js/i,
     }
   },
   stylesheets: {
     joinTo: {
       "css/app1.css" : /^app\/app1\/[a-z0-9_\-\/]\.less/i,
       //"css/app2.css" : /^app\/app2\/[a-z0-9_\-\/]\.less/i,
     }
   },
   templates: { joinTo: 'app.js' }
}

(I just commented out the lines for the sake of demonstrating the existence of other possible output files)

This would still find the "app2" related LESS files and attempt compiling them, resulting something like this:

warn: app\app2\some_stylesheet.less compiled, but not written. Check your stylesheets.joinTo config

Is there an existing option so that the LESS compiler only focuses on the pattern-matched files specified in joinTo?

chamberlainpi commented 8 years ago

Actually, nvm, this seems to be applicable to all file types (JS, CSS, etc.).

I think this may be related: https://github.com/brunch/brunch/issues/878#issuecomment-76236005

The answer provided by @es128 (regarding the paths.watched) might be the key to omitting the warnings.

es128 commented 8 years ago

Right. It would be a nice enhancement if in the future paths.watched was eliminated and watching was instead derived directly from the joinTo definitions in order to avoid this.