1

What's the state of the art when it comes to making Sinatra reload compiled SASS files in development? I've found that when I'm editing pure CSS the app updates on browser refresh. However when using .scss files (which I watch with sass --watch public/styles/scss:public/styles/css/) this doesn't work — I have to restart the above watch to see the latest changes (with the server running).

I've tried Sass::Plugin::Rack, Sinatra Reloader, and Rack::LiveReload, with no success.

fullstackplus
  • 1,061
  • 3
  • 17
  • 31
  • 1
    If your css files get build, it's probably browser caching a few ideas what you could do http://stackoverflow.com/questions/118884/how-to-force-browser-to-reload-cached-css-js-files – Sir l33tname Nov 25 '16 at 09:18
  • The CSS files only build properly when I use `sass --watch pu blic/styles/scss:public/styles/css/` — it's possible that I didn't implement any of the other methods correctly. – fullstackplus Nov 25 '16 at 10:10
  • 1
    Something like this https://coderwall.com/p/yjeajq/autoloading-sass-in-sinatra doesn't work? – Sir l33tname Nov 28 '16 at 09:07
  • I'd rather not use livereload — so can't say whether it does. I've decided to re-start the `sass --watch` process manually instead, it's a minor overhead when you're used to designing in the browser with CSS. – fullstackplus Nov 29 '16 at 19:38
  • I have been using rerun gem for a while and works like a charm and it reloads both ruby css and js files. You can find an example here how to use it when You start your server https://github.com/bogdanRada/ruby-gem-downloads-badge/blob/master/Procfile.dev . I am using this with Foreman gem to run my application. You might also want to consider adding rb-fsevent as a dependency for developement. Hope this helps :) – Rada Bogdan Dec 01 '16 at 22:48

1 Answers1

0

Issue solved — tried Sprockets but that didn't work because I'm using Ruby 1.9.3. Running sass --watch manually instead.

fullstackplus
  • 1,061
  • 3
  • 17
  • 31