You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have not got a reply on irc last week so I thought I would email you instead.
I wrote a JsCss compressor for django-compressor and was wondering whether it would be worth adding it to the django-compressor itself (I would need to add appropriate level of documentation and tests and make it nicer).
Features:
* compresses both javascript and css "at once"
* outputs javascript or css with attribute data-compress=false untouched
* outputs the rest of html untouched
So one can then put something like this into the base template:
and it will compress all js and css in all the templates that inherit from base. So any resulting html will then load at most one css and/or one js file. I use 'compress js' even though it's for both css and js simply because I didn't want to change the templatetag logic.
In this sense, it could even be made into a middleware class.
Attached is the source code of the compressor (it's quickly put together, nothing extra nice yet but it works quite nicely with one of our internal projects).
Sorry nobody got to you sooner. I feel this is a little too complex to have in compressor core, especially as it's not a common use-case. It should be possible to implement this outside compressor though.
Hi Jannis,
I have not got a reply on irc last week so I thought I would email you instead.
I wrote a JsCss compressor for django-compressor and was wondering whether it would be worth adding it to the django-compressor itself (I would need to add appropriate level of documentation and tests and make it nicer).
Features:
* compresses both javascript and css "at once"
* outputs javascript or css with attribute data-compress=false untouched
* outputs the rest of html untouched
So one can then put something like this into the base template:
and it will compress all js and css in all the templates that inherit from base. So any resulting html will then load at most one css and/or one js file. I use 'compress js' even though it's for both css and js simply because I didn't want to change the templatetag logic.
In this sense, it could even be made into a middleware class.
Attached is the source code of the compressor (it's quickly put together, nothing extra nice yet but it works quite nicely with one of our internal projects).
Cheers,
Tomas
The text was updated successfully, but these errors were encountered: