Looking for a python library that handles minifying and merging JS\CSS files together…
Looking for a python library that handles minifying and merging JS\CSS files together…
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As anurag said, Django users can use django-compress.
If you’re using Pylons or TurboGears 2.x, there are two real-time options:
To the best of my knowledge, the realtime options for Django and Pylons only do minification and concatenation. They don’t parse the Javascript to implement any kind of import/include directive.
If you prefer a batch option, I can’t think of anything written specifically in Python, but these are the options I’ve seen other Python developers using:
If a pure Python solution is really important, my advice is to either go with the realtime options (easier for development with things like
paster --reload) or write a command for setup.py or paster which uses jsmin.py and cssmin to do the heavy lifting.Note: Due to a lack of documentation, the setup.py link points to one of my blog posts.
This SO answer may also be useful:
Python script for minifying CSS?