2

With the tools we have today for assets optimization (for example YUI compressor), how do you automatize it?

For example, I have designed a new website using LESS, so every time I have to edit CSS I have to manually convert them to LESS. The same for Javascript.

So I have to make my PHP project to point to my uncompressed CSS/JS, and when I'm finished, I compress/optimize them, and point my project to the optimized ones again.

I know that there are tools that helps with this (like less.app, which I've used), and that even there are PHP libs that manage all this problem (like Assetic), but I don't like them much. I'm searching for a "programmed" way to deal with optimized assets. Maybe some script that "watches" the uncompressed files or something...

I wish I could have too many alternatives as the Django framework has.

Please, if the question is not well redacted, tell me and we can improve it, so we can establish a good practice for assets :)

David Morales
  • 17,816
  • 12
  • 77
  • 105
  • http://stackoverflow.com/a/8512563/1095276.You can do this way.I am not a php developer.In asp.net we can urls of css and js files used in the project in config file.In the same config file will create keys which will group them,so will create one key for css and one for js for each page ,and when the page is requested use the keys to get the files and compress them and send it to the user using httpcombiner(bascially a handler). – kvc Dec 16 '11 at 12:40

1 Answers1

0

I think one efficient solution would be to do this task on the development side, when writting code, and point the code to the optimized files.

One tool that seems to work well is Live Reload (only for OS X, although there is a Windows version on the way).

I like this option as there is no overload on the code to maintain assets.

David Morales
  • 17,816
  • 12
  • 77
  • 105