Add compress skip patterns from settings#297
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_REGEXsettings (--skip-regexpparameter)WHITENOISE_COMPRESSOR_CLASSsettings (--compressor-classparameter)@LucidDan @merwok Please take a look at this. If everything is OK, I will add documentation for the new parameters/settings.