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
Does not reload cache when @import less files are changed in development #274
Comments
I am having a similar issue
stlye.less
It is pulling in a bootstrap.less but not the one it should be. When I make changes to the bootstrap file no changes are made, but if i change the name of the file and the import, Does compressor cache the import files? I would really like to get this fixed. Thanks for any help |
The only way to solve this issue seems to use compress offline. Or did anyone find another solution? |
+1 |
Did anybody ever resolve this? I don't really see how compressor would be able to solve this since this is implemented as a filter, i.e. it is out of it's control. If you touch the parent file and run collectstatic it seems to work. What I'm doing now is this: http://www.caktusgroup.com/blog/2012/03/05/using-less-django/ |
Well compressor could parse the less file and check the all the referenced files for the modification times... |
That would mean compressor should know how to parse and detect included files for every pre-compiled format on earth, not just less... |
Uh, yes... that would be a bit of a stretch... any other ideas? |
One solution is to simply use COMPRESS_ENABLED = False for development, which doesn't de-activate the precompilation step. Ironically, some users complained that compressor doesn't cache the results when COMPRESS_ENABLED is False... (see #346) It's hard to please everyone :) |
To have a filter-independent solution, a possibility is to have optional configuration that instructs compressor of file dependencies (in this case, less file imports). E.g. app.less is included on page and imports other less files: app.less -> footer.less, typography.less So that when app.less is encountered by compressor it checks to see if footer.less and typography.less have changed in addition to itself. If so, it pre compiles app.less. Thoughts? Sent from my iPhone On Feb 15, 2013, at 2:52 AM, Julian Bez notifications@github.com wrote:
|
IMHO, this goes against one of django_compressor's core principles : you shouldn't need to play with settings to generate the compressed content. Also, this violates DRY since you have your dependencies specified twice (once in the file itself, once in the settings). This is bad for maintenance. |
I guess I'll have to try compression = false again ... But I don't think that worked for me last time I tried it. I know it's not optimal or DRY, but it's really the developer's problem at that point. To me it's better than other available options. Sent from my iPhone On Feb 15, 2013, at 10:18 AM, Mathieu Pillard notifications@github.com wrote:
|
For what it's worth, it's pretty straightforward to parse Less for imports. Just strip out comments with a regexp, then look for Would you be wiling to accept a PR that did this for django_compressor? |
It isn't a big deal to have Maybe if there could be some way to tell compressor to use specific filters even if compression is disabled? |
I've been giving django-pipeline a shot and it handles this pretty well at first glance. Sent from my iPhone
|
I'm using this management command to detect changes in all .less files in my project and then touch the main less file which is included in the html so that django-compressor recompiles. |
Thx for heads up, however I've since moved on to django-pipeline which deals with this nicely.
|
|
I'm having the same problem. I thought "manage.py compress --force" should deal with this, but it does not. It generates a new css file in static/CACHE, but the link elements in the html files don't change and still point to the old version in static/CACHE. AFAICT "manage.py compress --force" is only useful if one accidentally deleted the files in CACHE. Is that really the intended behavior? |
I think that this PR's solution is best because:
The only downside is that other
|
It's pretty straightforward
template.html
bootstrap.less
If I make a change in _stylesheet.less, I have to restart runserver to see the change. compress doesn't do it automatically.
I know that there are several ways around this, it's just a bug I encountered.
Here are my settings
The text was updated successfully, but these errors were encountered: