简体   繁体   中英

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 comments, 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?

您可以使用链轮 (默认情况下在Rails 3.1+中)或jammit来实现

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM