-
Notifications
You must be signed in to change notification settings - Fork 147
Usage
zzeroo edited this page Jun 18, 2019
·
2 revisions
Livereload tells your browser to refresh when files change.
For this to work, guard-livereload has to somehow send the livereload.js
script to your browser.
There are 2 ways to do this:
- Use a LiveReload plugin in your browser
- Add a special snippet to your web page (automatically or manually)
- Run
guard
soguard-livereload
starts listening for browser connections - Start your app or server (
rails s
,jekyll serve
,rackup
, etc.) - Find a livereload plugin for your browser and install it
- In your browser, open the url you're working on, e.g.
http://localhost:3000/about
- In your browser, enable LiveReload on that page, e.g. click the livereload toolbar icon in Chrome (until the little circle becomes filled in) or in Safari right-click on the page and enable LiveReload
If you're using Rails or Sinatra, you may just check out: https://github.com/onesupercoder/rack-livereload#readme
(This automatically adds the snippet to every page served to the browser)
If you're not using a Rack-based server, you can manually add the snippet as described here: http://feedback.livereload.com/knowledgebase/articles/86180-how-do-i-add-the-script-tag-manually-
(Of course, you probably don't want the snippet added on your production code).