Rails 3.1 asset pipeline doesn't pick up changes to @import'd sheets

让人想犯罪 __ 提交于 2019-12-02 18:15:01

Using a depend_on directive may do what you require. This makes the given file a dependency of the base file (so the base file is regenerated when the dependency changes), but doesn't include it in the bundle.

For example:

/*
*= depend_on _layout.sass
*= depend_on _constants.sass
*/
@import _layout.sass
@import _constants.sass

See this sass and sprockets blog post as well as the sprockets documentation (especially the directives section).

The answer from nanothief led me to the solution (thank you!) but in an indirect way. Once I finally found the time to get back on here and look up the referenced post, it had been updated to say that the fix was no longer needed.

Sure enough, it appears that this bug has been fixed in Rails 3.1.0 stable with sass-rails for 3.1.0. So good! I've confirmed that updating the gems does get everything back to working correctly, tested in a couple of apps.

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