-
-
Notifications
You must be signed in to change notification settings - Fork 3
@import won't work correctly #1
Comments
👍 I had the same issue. Essentially, you can tell This is as close as I could get to making // put the "top level" less files in a folder by themselves
// these files have `@import` lines inside them
var cssSource = broccoli.makeTree('client/css/main');
cssSource = bless(cssSource, {
// put dependencies in a separate directory for the less command to search through
paths: './client/css'
}); |
Yes, we'll have a proper solution for that. It will allow you to pass input trees into LESS/Sass, and changes will be picked up correctly. Haven't had the time to get started on this, but it's high on my list. |
Check out this implementation of broccoli-sass: https://github.com/joliss/broccoli-sass/blob/master/index.js I think you should be able to copy from it. It currently doesn't come with caching. I'm assuming that sooner or later we'll have to add a caching wrapper around it. Getting the invalidation right without making spaghetti code is a bit tricky. Perhaps libsass is blazing-fast enough that we can do without caching, but clearly for LESS we'll need caching. I shall write about caching for multi-file compilers like Sass or LESS at some point. |
@joefiorini just pointed me here: in order to fix compilation in ember-cli, I just published a couple new broccoli plugins for compiling LESS and Stylus that are based (very) heavily on your broccoli-sass, @joliss It looks like broccoli-less and broccoli-stylus are currently mapping input I could see there being some valid use-cases for wanting this one-to-one mapping, but it seems like in general people will want the the n-to-one semantics. @sindresorhus do you want to change this package to be n-to-one, or just leave this as is, and have a separate package for when people need a dependency tree? Either way, at least we'll now have working compilation in ember-cli :) |
I (tentatively) agree, for what it's worth. I polled a bunch of people on Twitter a while back, and it seems that it's common to have many input Sass/LESS/... files, but only 1-4 ouput files. When I looked into it with Sass, I saw that Rails by default compiles all the |
Yes, just haven't had the time. Help welcome :) |
Follow the lead of broccoli-sass when something happens there.
The text was updated successfully, but these errors were encountered: