Rails: Use livereload with Asset Pipeline

前端 未结 3 1799
北海茫月
北海茫月 2020-12-15 08:23

Quick question for rails pros out there...

When working with Rails 3.0.x apps I was a heavy user of Guard and LiveReload. However, it seems that when using the asset

3条回答
  •  暖寄归人
    2020-12-15 08:42

    As @mirko mentioned in his comment, extra .css on scss files is deprecated. So adding that isn't a great solution, and I've experienced that simply adding the scss extension forces a page reload.

    So I found that this works:

    watch(%r{(app|vendor)(/assets/\w+/(.+)\.(scss))}) { |m| "/assets/#{m[3]}.css" }`
    

    My understanding is this maps the scss file to the compiled css file. I hope it works for sass too.

    Source: Github Issue

提交回复
热议问题