Ruby on Rails: Minify or Compress Javascript Files?
Currently there is this in my <head>
<%= javascript_include_tag 'jquery-1.6.3.min', 'jquery.form', 'jquery.validate', 'script', :concat => true %>
This means Rails produces an all.js
File with all js-files combined in it.
Is there some way in Rails to also minify or compress the js files? I mean like getting rid of co开发者_开发问答mments, whitespace, whatever a js compressor typically does. I'm just curious because with an automated compression like this I wouldn't have to manually compress the js files each time I change something.
Any ideas on that?
You could do that using sprockets (by default in Rails 3.1+) or jammit
精彩评论