Skip to content

Commit

Permalink
Giving explicit --watch paths now disables mounted paths from watching.
Browse files Browse the repository at this point in the history
For consistency reasons. Closes #84.
  • Loading branch information
tapio authored and bmuenzenmeyer committed Feb 23, 2018
1 parent 218c54c commit 759007d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/live-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Version history
* master (unreleased)
- Updated most dependencies to latest versions
- `--quiet` now silences warning about injection failure
- Giving explicit `--watch` paths now disables adding mounted paths to watching
* v0.9.1
- `--ignorePattern=RGXP` exclude files from watching by regexp (@psi-4ward)
- `--watch=PATH` cli option to only watch given paths
Expand Down
3 changes: 2 additions & 1 deletion packages/live-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ LiveServer.start = function(options) {
var app = connect();
mount.forEach(function(mountRule) {
var mountPath = path.resolve(process.cwd(), mountRule[1]);
watchPaths.push(mountPath);
if (!options.watch) // Auto add mount paths to wathing but only if exclusive path option is not given
watchPaths.push(mountPath);
app.use(mountRule[0], staticServer(mountPath));
if (LiveServer.logLevel >= 1)
console.log('Mapping %s to "%s"', mountRule[0], mountPath);
Expand Down

0 comments on commit 759007d

Please sign in to comment.