Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
LiveReload development instructions. Basically a wiki for LiveReload hackers.

Developing LiveReload on a Mac

Mac directory structure

Under ~/dev/livereload:


These modules use each other, so you want to npm link them together for development.

Windows folder structure and backend override

Copy ~/dev/livereload from Mac to Windows into C:\Dev\livereload.

Set up the following directory junctions (best way is to use Alt-F6 in FAR Manager):

C:\Dev\livereload\node_modules\livereload-protocol     →        C:\Dev\livereload\modules\protocol
C:\Dev\livereload\node_modules\livereload-client       →        C:\Dev\livereload\modules\client
C:\Dev\livereload\node_modules\livereload-server       →        C:\Dev\livereload\modules\server
C:\Dev\livereload\node_modules\livereload-core         →        C:\Dev\livereload\modules\core
C:\Dev\livereload\node_modules\fsmonitor               →        C:\Dev\livereload\generic\fsmonitor.js
C:\Dev\livereload\node_modules\jobqueue                →        C:\Dev\livereload\generic\jobqueue
C:\Dev\livereload\node_modules\pathspec                →        C:\Dev\livereload\generic\pathspec.js
C:\Dev\livereload\node_modules\reactive                →        C:\Dev\livereload\generic\reactive
C:\Dev\livereload\node_modules\vfs-local               →        C:\Dev\livereload\generic\vfs-local
C:\Dev\livereload\node_modules\vfs-test                →        C:\Dev\livereload\generic\vfs-test

At this point, the backend should run:

cd C:\Dev\livereload\app\2_4\cli
node bin\livereload.js --help
node bin\livereload.js rpc server

Also you should be able to run LiveReload.exe with the following command-line arg:

-LRBackendOverride C:\Dev\livereload\app\2_4\cli

Now you can install Bitvise SSH Server, put your Mac public key in, and make sure you can connect to your VM:

$ ssh andreyvit@

Add the following into your ~/.ssh/config to make things easier (replacing User and HostName as needed):

Host w8
  User andreyvit
  ControlPath ~/.ssh/master-%l-%r@%h:%p

Now this should work:

$ ssh w8

Keep the following command running, and it should speed up subsequent ssh w8 a great deal:

# in Terminal 1...
$ ssh -MN w8
# in Terminal 2...
$ ssh w8    # this should work INSTANTLY 

Great! Now make sure you have npm install -g fsmonitor installed on your Mac, and run:

$ cd ~/dev/livereload
$ fsmonitor '-J%' '+*.js' '!/app/*/*' '+/app/*/cli' '!node_modules' '!*.lrplugin' '!.git' '!/support'  scp '%' 'w8:c:/dev/livereload/%'

This will upload any changes to your Windows VM. Check this out by doing:

$ date >~/dev/livereload/ok.js

and then verify that C:\Dev\livereload\ok.js contains the current time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.