Best way to combine and minify JS / CSS on Heroku

后端 未结 8 1279
梦谈多话
梦谈多话 2020-12-24 06:39

First of all, according to this answer, the :cache => true option on stylesheet_link_tag and javascript_include_tag doesn\'t work o

8条回答
  •  离开以前
    2020-12-24 07:05

    I'm using Jammit on Heroku. Works Great. You can locally build your assets and check in to heroku. use

    jammit --force
    

    the current version 0.5.1 has issues working on heroku but you can install the fixed version from git://github.com/documentcloud/jammit.git

    If you are using Rails 3, specify the below in your bundler Gemfile:

    gem "jammit", :git => "git://github.com/documentcloud/jammit.git"
    

    For Rails 2.*

    config.gem "jammit", :source => "git://github.com/documentcloud/jammit.git"
    

    Good Luck.

提交回复
热议问题