what does the livereload
in grunt do, does watch
already do what we want? For example if we run the server at port 9000 and the livereload server runs at port 9001. What will happen when there are changes in the files we are watching, should we see the newest content at example.com:9001
or example.com:9000
?

- 7,367
- 19
- 54
- 80
-
livereload has been deprecated in favour of [watch](https://github.com/gruntjs/grunt-contrib-watch#optionslivereload). – Andy Jun 27 '14 at 13:03
-
@Andy hmmm..so what does this livereload port number do? why we need it? – Blake Jun 27 '14 at 13:14
-
Sorry, I just realised that you mentioned `watch` in your question. I'll try and reply below. – Andy Jun 27 '14 at 13:17
1 Answers
The short answer is I don't think you can do both. You can either have a simple node server running without livereload or livereload running as part of a node application. So, you can have your node server running on port 9000 or have livereload running as part of the node application on port 9001 (tho its default port is 35729).
I can only speak from my own experience on this. In my case I've used livereload when I am developing new code on my local development machine with Yeoman - it's a built in feature of the webapp generator. Confusingly is that, while it defaults to port 35729, the generator implements connect-livereload
, sets its port to 9000, and runs livereload through that, so that when run grunt server
you open your application at port 9000 and livereload updates that port instead.
I would recommend reading the full documentation for watch
particularly the section about connect-livereload
is you want to know more.

- 61,948
- 13
- 68
- 95