-
-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using the Less filter, there's no way to combine CSS and Less in a bundle #120
Comments
See the CSS compiler documentation page - your first bundle should include |
If it has an output file I can't really debug errors - the files should be separate to debug them correctly. Anyway I did this as a temporary workaround:
|
I see, so in development mode, you would like the use the ability to compile less browser-side, but for production, you want to precompile it on the server. Your workaround seem very much correct, because as far as I can see, any "proper" solution to this would essentially be for the assets tag to provide some sort of {{REL}} variable that can be used at this point. And the code behind the REL variable could at most do what you are doing: looking at the file extension. I'm not convinced that some kind of big architecture, with hooks for filters and the like, is warranted here. What I would suggest is supporting arbitrary values that can be passed along, something I've wanted to add for a while:
which let's you write your template like this:
And could be used for things like media='print':
|
That looks like a good solution. My other idea was to subclass Bundle, so like:
etc, which has its own render thing. Then you'd just do:
or similar. |
Type-aware Bundles are planned, in #12. It's a bigger untertaking though. |
This is actually related to #60 as well, which would configure filters like less to always run. Clearly, at least for less, there are cases where you might not want the compilation to happen. |
Filters can now declare that they need to run in 'merge' mode (cssrewrite), or that they need to run always (compiler-type filters). In the latter case, if such a filter is used, the bundle will automatically be merged. This is a more limited change than it sounds - still, see the section on backwards-incompatibilities in the docs for more info. Closes #60, and solves the requests in #73, #102 and possibly others. Some relation to #120.
Add a LESS_RUN_IN_DEBUG option to make this easier. Final commit for #120.
Given this Bundle code:
and this template:
I can't combine my Less file and my CSS file in a final file as it won't work in development (due to not having
rel="stylesheet/less"
in the file).The text was updated successfully, but these errors were encountered: