Skip to content
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

Config for allowing .scss files with dependencies #20

Closed
k-funk opened this issue May 20, 2016 · 2 comments
Closed

Config for allowing .scss files with dependencies #20

k-funk opened this issue May 20, 2016 · 2 comments

Comments

@k-funk
Copy link

k-funk commented May 20, 2016

This issue was posted in django-compressor. I'm not sure which library would be best to provide this support.

The problem is that I can't use a variables.scss separate from other dependencies.
I've got around this by using a main.css and lots of @imports in there, which works just fine and is clean enough to me, but django-compressor doesn't notice when files other than main.scss are changed, requiring a server-restart for any scss that were @imported.

Webassets solved this by setting a SASS_AS_OUTPUT flag that concats files before processing them.

Do you think it's best solved in django-compressor or here?

@gasman
Copy link
Member

gasman commented May 23, 2016

Hi @k-funk,
If I'm not mistaken, the only time django-compressor checks for changes to source files is when you have the precompiler listed in COMPRESS_CACHEABLE_PRECOMPILERS - and the docs tell you not to use this for SASS compilers, for exactly this reason.

The default behaviour without COMPRESS_CACHEABLE_PRECOMPILERS is to recompile everything on every request - which sounds inefficient, but I haven't found it to be a problem. (libsass is quite fast, and invoking it as a library rather than an external program helps to reduce overheads too.) In production, offline compression is the best way to go (although COMPRESS_CACHEABLE_PRECOMPILERS would probably work nicely there, as you won't be changing files between server restarts).

Either way, I think this is out of scope for django-libsass - django-libsass just follows django-compressor's precompiler API, and compiles whatever files django-compressor tells it to.

@gasman gasman closed this as completed May 23, 2016
@k-funk
Copy link
Author

k-funk commented May 23, 2016

Thanks for the response. Didn't know that the default behavior is to recompile everything, which led me to discover that having COMPRESS_ENABLED = True was the reason that my application wasn't recompiling with each request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants