Skip to content

Instantly share code, notes, and snippets.

@weiland
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save weiland/1e11b8aaa170c5c54e76 to your computer and use it in GitHub Desktop.

Select an option

Save weiland/1e11b8aaa170c5c54e76 to your computer and use it in GitHub Desktop.
Including Livereload without browser extension (e.g. CR9S)

Livereload without browser extension

make sure to install livereload globally on your system! \o/

npm install -g livereload`  

run livereload in your local directory or run a watch script

livereload = require('livereload');  
server = livereload.createServer();  
server.watch(__dirname + "/stuffToChange");

embed the script in your HTML:

<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>

alternatively use a hostname working on a different server:

<script src="http://hilariousHorst:35729/livereload.js?snipver=1"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment