Tuesday, September 3, 2013

Symfony2: YUI_Compressor

YUI compressor is used to compress files, for example javascript and css files, into minified.
When it is used with symfony2, sometimes it doesn't work even though you correctly add it.
In this case, the app/console command is provided to help you solve the issue. It is used to directly generate the minified.
$ php app/console assetic:dump --env=prod  

The result will show up the number of minified files. Moreover, you can let it show the progress by adding the -v at the end of command, it should be looked like this: 
$ php app/console assetic:dump --env=prod -v

The -v shows more details about the process of compression, you can see if there is an error which causes problems with yui compressor, and fix it!

No comments:

Post a Comment