Recently I have tried Django-Compressor. It's awesome and i like it too much, but i am having some troubles with offline compression (COMPRESS_OFFLINE = True
) and template tags.
I have {{ django_vars }}
and {% django_tags %}
inside my JS code and i guess Google Clousure compiler (the filter what i'm using with Django-Compressor) doesn't know to identify them. In fact, I think Django template structures like {% if something %}
are deleted.
How can i do to keep all this template vars/tags in my code JS after compressing?
Thanks mates.
Edit:
Finally, i discovered all problems that i got using COMPRESS_OFFLINE
, they all occurred due to a bug. They were not about Django syntax inside of JS code. The bug always appeared when you tried to compress JS code inside of a file .html, not a external JS. It failed with all parsers and all compilers/compressors.
Now, although i like more django-compressor than django-pipeline, i'm using this last one. At this moment, no problem reported with compression.
Thanks to all who tried to help me.