How to disable adding “.self.” in Sprockets 3.0

点点圈 提交于 2019-12-03 06:30:31

问题


Even if config.assets.digest = false is set Sprockets 3.0 keep adding .self. to all static files: application.css becomes application.self.css?body=1

How to disable adding self? It is needed for correct browsersync work.


回答1:


In Sprockets 3, .self.css is added because you have the config.assets.debug = true config set (not the digest config, that's unrelated).

If you add the following to your development.rb or production.rb file, it will work as you expect:

config.assets.debug = false



回答2:


Downgrading sprockets worked for me. Add the following to your Gemfile

gem 'sprockets', '2.11.0'

and run

bundle update sprockets


来源:https://stackoverflow.com/questions/29732377/how-to-disable-adding-self-in-sprockets-3-0

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