live-server
live-server copied to clipboard
Not ignoring .git files, despite being put in ignore params
Hello! Really enjoying live-server, but I find that my level 2 log output gets cluttered quickly because a change is constantly detected in the file ./.git/index
. I tried adding .git to my ignore params field, but it did not work. Things I tried in params: ignore: .git
, ignore: .git/*
, ignore: .*
, and ignore: .git/**
. Would love some help! Thanks.
Hi, same story here.
This does not work for me:
live-server --ignore=".git, .idea"
I think the simple example in the readme for the CLI inputs would be great.
Thank you!
$ node --version
v8.9.0
$ live-server --version
live-server 1.2.0
I was going to investigate it and possible fix it but after seeing 14 pull requests I wonder if this project is still maintained..
I had a bit of a dig into it and I believe it is an issue with the underlying use of chokidar, but it's a bit of a ball of mud to try and sort out.
While the docs say --ignorePattern
is deprecated, it still works so use --ignorePattern=".git*"
and for multiple items e.g. a directory called docs
use --ignorePattern=".git*|docs/*"
Docs need some updating.. see: https://github.com/tapio/live-server/issues/178 @tapio @pavel this can be closed
Note: the solution (from #178) is to explictly tell live-server
to start in the current directory (./
). Then it will properly resolve --ignore
paths:
live-server --ignore=.git,node_modules ./
A hard looking for solution:
live-server --port=8000 --watch=./** --ignore=./dist/app.bundle.js.map,./src ./
./ To start on the current directory as @unitof said. --watch=./** To watch for all changes starting from the current directory. --ignore=./dist/app.bundle.js.map,./src To ignore the files and folders with a relative path.
This also seems to work
live-server --ignore="$PWD/.git/**"
Ideally relative paths should be resolved to absolute paths
...
The issue seems to be that by default the root dir is process.cwd()
which is an absolute path, so ignore patterns should match against absolute paths. Considering that these are patterns, probably it would not be easy to resolve them to absolute patterns. So the best option seems to pass .
as root dir as suggested above.
Probably not a bug, but should be documented to avoid surprises.