joliss / broccoli-sass

Sass compiler for Broccoli, using libsass
MIT License
44 stars 97 forks source link

Worthwhile to add unwatched dependencies? #20

Closed ericeslinger closed 10 years ago

ericeslinger commented 10 years ago

This is more of a question than an issue, but if people think this may be a good idea, I'll give it a shot.

Basically, I have quite a few SCSS dependencies (all my bower deps like bourbon, neat, bitters, etc), none of which are expected to actually change. Adding bourbon to my project a while back ended up with me needing to up my ulimit, as broccoli was trying to stat too many files at once. (granted, that was a while back, and I don't know if broccoli still works that way). I have similar things going on with bootstrap-sass in another project.

Currently, I've changed the way I run broccoli to use the middleware functionality, so I can have a regular connect server serving up my bower_components (which is sizeable but static) without having to watch those files. This works for everything except the SCSS files in bower_components, which need to get passed in to broccoli-sass and therefore get watched unnecessarily (I won't be editing anything in bower_components).

What I'm thinking may be useful would be to split the include path into watched and unwatched bits. The watched stuff would behave just like the includepath now - generate watched trees. The unwatched stuff would just be a directory passed straight to node-sass without getting watched by broccoli.

This may also end up being premature optimization, because really - there's far fewer than 100 library SCSS files in bower_components anyway. On the other hand, I pass the directories as plain old strings to relative folders into broccoli-sass ('bower_components/bourbon', etc), so I imagine that the static compiler is actually watching all the other crap in those directories and not just the SCSS files.

Thoughts? Ideas? This may end up being one of those things that just bugs me because it's not super-elegant, but at the same time isn't a big deal.

simonexmachina commented 10 years ago

broccoli-sass doesn't actually have the notion of "include paths", it uses the input trees for these. You can specify the input trees as strings, or as actual broccoli trees, which means that you can use broccoli-unwatched-tree to provide your bower_components files.

Simple :)

ericeslinger commented 10 years ago

Ah, broccoli-unwatched-tree is definitely the way to go here. Beats modifying the broccoli-sass plugin, and that plugin is a lot more generalizable.

simonexmachina commented 10 years ago

Yep, that's very much the style of the broccoli ecosystem - we really try to maintain the purity of the modules. They should do exactly one thing and do it well :)​