Hi,
I am starting a new rails project and is there any rails plug in I can use that will minify my javascript and combine it into 1 file?
I would imagine there might be a rake task for this.
What would be used for this in rails?
Cheers
Paul
Hi,
I am starting a new rails project and is there any rails plug in I can use that will minify my javascript and combine it into 1 file?
I would imagine there might be a rake task for this.
What would be used for this in rails?
Cheers
Paul
There are several actually:
I've only used asset packager, and its been nothing but a joy.
Also worth reading: http://github.com/blog/551-optimizing-asset-bundling-and-serving-with-rails
Rails has built in javascript file merging.
http://apidock.com/rails/ActionView/Helpers/AssetTagHelper/javascript%5Finclude%5Ftag
javascript_include_tag :all, :cache => true
I then use nginx's built in gziping to compress the file size, since it does a pretty good job. There are numerous plugins to do it also:
http://github.com/sbecker/asset%5Fpackager/ http://github.com/sstephenson/ruby-yui-compressor/