You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-9Lines changed: 36 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,7 @@ The commandline options are
65
65
*`-x` or `--exclusions` to specify additional exclusion patterns. Example: `-x html, images/`.
66
66
*`-u` or `--usepolling` to poll for file system changes. Set this to true to successfully watch files over a network.
67
67
*`-w` or `--wait` to add a delay (in miliseconds) between when livereload detects a change to the filesystem and when it notifies the browser.
68
+
*`-op` or `--originalpath` to set a URL you use for development, e.g 'http:/domain.com', then LiveReload will proxy this url to local path.
68
69
69
70
For example, to use a wait time and turn on debugging so you can see messages in your terminal, execute `livereload` like this:
70
71
@@ -84,6 +85,13 @@ The file path can be at any place in the arguments. For example, you can put it
84
85
$ livereload -e 'html' public/
85
86
```
86
87
88
+
Finally, you can tell LiveReload to refresh the browser when specific filenames change. This is useful when there are files that don't have extensions, or when you want to exclude all HTML files except for `index.html` throughout the project. Use the `-f` or `--filesToReload` option:
89
+
90
+
```sh
91
+
$ livereload -f 'index.html' public/
92
+
```
93
+
94
+
All changes to `index.html` in any subdirectory will cause LiveReload to send the reload message.
When `/User/Workspace/test/css/style.css` is modified, the stylesheet will be reloaded on the page.
195
204
205
+
# Troubleshooting
206
+
207
+
## The browser extension doesn't connect.
208
+
209
+
If you're using `file:///` urls, make sure the browser extension is configured to access local files. Alternatively, embed the `livereload.js` script on your page as shown in this README.
210
+
211
+
## When I change the HTML page I'm working on, the browser refreshes and tells me the file isn't found.
212
+
213
+
Your editor is most likely using a swapfile, and when you save, there's a split second where the existing file is deleted from the file system before the swap file is saved in its place. This happens with Vim. You can disable swapfiles in your editor, or you can add a slight delay to Livereload using the `-w` option on the command line.
214
+
215
+
216
+
196
217
# Developing livereload
197
218
198
-
This library is implemented in CoffeeScript 1.x. It may eventually be converted to JavaScript, but
199
-
because there are many projects that depend on this library, the conversion isn't a priority.
219
+
This library is implemented in CoffeeScript 1.x. It may eventually be converted to JavaScript, but because there are many projects that depend on this library, the conversion isn't a priority.
200
220
201
221
To build the distributable versions, run `npm run build`.
202
222
203
223
Run `npm test` to run the test suite.
204
224
205
225
# Contributing
206
226
207
-
Contributions welcome, but remember that this library is meant to be small and serve its intended purpose only. Before submitting a pull request, open a new issue to discuss your feature or bug. Please
208
-
check all open and closed issues.
227
+
Contributions welcome, but remember that this library is meant to be small and serve its intended purpose only. Before submitting a pull request, open a new issue to discuss your feature or bug. Please check all open and closed issues.
209
228
210
-
When submitting code, please keep commits small, and do not modify the README file. Commit both the Coffee and JS files.
229
+
When submitting code, please keep commits small, and do not modify the README file. Commit both the Coffee and JS files.
211
230
212
231
# Changelog
213
232
214
233
### 0.9.2
234
+
* Server: Added `filesToReload` option to specify a list of filenames that should trigger the reload, rather than relying on extensions alone.
235
+
* CLI: You can use the `-f` or `--filesToReload` option with the command line tool to specifiy filenames that should trigger a reload.
215
236
* CLI: The file path is no longer fixed to a specific position in the arguments list
216
237
* CLI: You no longer need to specify the file path when using additional arguments
217
238
* CLI: You can use the `-op` or `--originalpath` option with the command line tool instead of writing your own server.
239
+
* CLI: The help screen displays more accurate option descriptions.
240
+
* Tests: Added more specific tests to ensure that refresh is called in various scenarios.
241
+
* Other: Removed `Cakefile` as Cake is no longer needed. Use `npm run tests` and `npm run build` instead.
242
+
* Dependencies: Updated `chokidar` dependency to 3.5.1
243
+
* Dependencies: Updated `livereload-js` dependency to 3.3.1
244
+
* Dependencies: Updated `ws` dependency to 7.4.3
218
245
219
246
### 0.9.1
220
247
* Fix issue with livereload.js not resolving properly on some projects (caseywebdev)
@@ -274,7 +301,7 @@ When submitting code, please keep commits small, and do not modify the README fi
274
301
275
302
### 0.4.1
276
303
* Remove some bad JS code
277
-
*
304
+
278
305
### 0.4.0
279
306
* Rewritten using Chokidar library and `ws` library
280
307
* Added `usePolling` option
@@ -284,6 +311,6 @@ Older version history not kept.
284
311
285
312
# License
286
313
287
-
Copyright (c) 2010-2019 Brian P. Hogan and Joshua Peek
314
+
Copyright (c) 2010-2021 Brian P. Hogan and Joshua Peek
288
315
289
316
Released under the MIT license. See `LICENSE` for details.
0 commit comments