Question about js/css compressor ?
montabou opened this issue · comments
I was wondering why the yui_js and yui_css compressors are hardcoded in https://github.com/symfony2admingenerator/AdmingeneratorGeneratorBundle/blob/master/Resources/views/base_admin.html.twig
I see different problems about that:
- On symfony website, it's written:
«The YUI Compressor is going through a deprecation process »
http://symfony.com/doc/current/cookbook/assetic/yuicompressor.html - It needs java to be installed on webserver
- It forces user to compress using yui or to overwrite the complete javascripts/style blocks of base_admin
I think there are 2 solutions:
- simply remove the js/css compressor and let the user to compress js/css using apply_to paramater of assetic (- Pro: do not require people to install extra compressor that they may not use - Con: js/css are not optimized with s2admingenerator default parameters)
- compress with a php compressor as https://github.com/mrclay/minify and/or https://github.com/natxet/cssmin (- Pro: works using only php - Con: Force user to compress using s2admingenerator compressor configuration)
Waiting for your feedback, I can do a PR if you want.
For me the best choice is the first one that let the user to configure js/css stuffs as he wants
Linked to avocode formextensions with symfony2admingenerator/AvocodeFormExtensionsBundle#11 and symfony2admingenerator/AvocodeFormExtensionsBundle#110.
I'm planning to change to uglifyjs and uglifycss soon.