Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable adding ".self." in Sprockets 3.0

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.

like image 314
Dmitry Dushkin Avatar asked Apr 19 '15 16:04

Dmitry Dushkin


2 Answers

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
like image 191
fotinakis Avatar answered Nov 02 '22 22:11

fotinakis


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

gem 'sprockets', '2.11.0'

and run

bundle update sprockets
like image 33
david_adler Avatar answered Nov 02 '22 23:11

david_adler