How to avoid precompiling in Rails >= 3.1 asset pipeline when changing application.js

柔情痞子 提交于 2019-12-04 20:01:06
Sandro L

One has to manually do

 $ bundle exec rake assets:clean

Which will remove all files in [app]/public/assets/. (Caution with otherfiles there, belonging to a model (like users pics), they also get removed!).

When the files do not exist the original ones are used. So precompiling assets seems not necessary for development mode.

Thanks @shingara for the hint in his comment to the question.

Something which might be a factor is if the following directive is in config/application.rb:

config.assets.precompile  += [ 'asset-file', ... ]

This should either be limited to 'fixed' asset files, or moved to config/environments/production.rb.

Not sure if that is happening with your situation, however it would produce similar results of not seeing changes after editing the asset file. Not precompiling assets will save you from needing to compile them each iteration in development.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!