-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add compress skip patterns from settings #297
base: main
Are you sure you want to change the base?
Conversation
83b87d5
to
299abb0
Compare
299abb0
to
720d4ef
Compare
for more information, see https://pre-commit.ci
…SSOR_CLASS parameters
I'd prefer not to add the regex setting when users can achieve the same in a few lines of code with a custom (Also your example for the regex strays a bit from the recommended setup. Sass/Less files should not be in the directory that Whitenoise serves - only compiled CSS files. So this makes me pause to think if the idea of skipping some files for compression is really valid, or it could be solved with better guidance for project structure.) |
@adamchainz My complete regex list is:
and while some of the scss might be possible to put outside static files dirs, others might be quite difficult. For example, I think, that skipping compression of files by pattern is quite clear use-case and having to override the Compressor class would make unnecessary complexity in settings files. But anyway, I can make separate MRs for those two things, so you can merge the |
This combines both approaches to skipping files mentioned in #279:
WHITENOISE_SKIP_REGEX
settings (--skip-regexp
parameter)WHITENOISE_COMPRESSOR_CLASS
settings (--compressor-class
parameter)@LucidDan @merwok Please take a look at this. If everything is OK, I will add documentation for the new parameters/settings.