-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for watching symlinks that resolve to paths outside the watch folder #231
Comments
1 task
find a sample project to demonstrate the issue below: |
bartvandenende-wm
changed the title
Watchpack does not monitor files within a symlink folder
Watchpack exposes resolved symlink paths on Dec 19, 2023
ignored
option
bartvandenende-wm
changed the title
Watchpack exposes resolved symlink paths on
Add support for tracking non-resolved symlink paths
Dec 19, 2023
ignored
option
bartvandenende-wm
changed the title
Add support for tracking non-resolved symlink paths
Add support for watching symlinks that resolve to paths outside the watch folder
Dec 19, 2023
Related issue #190 (comment) |
@bartvandenende-wm Sounds good for me, do you want to send a PR? |
ArjhanToteck
added a commit
to ArjhanToteck/watchpack
that referenced
this issue
Mar 7, 2024
Solves webpack#231 and updates the README to match.
ArjhanToteck
added a commit
to ArjhanToteck/watchpack
that referenced
this issue
Mar 8, 2024
Solves webpack#231 and updates the README to match.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature request
Watchpack
followSymlinks
option always resolves the directory / file paths to final link target. This can create unwanted side-effects if the target is outside of the watched directory and/or ifignored
filters.It would be great to have an option that would transparently follow symlinks without resolving to the target path.
What is the expected behavior?
I would expect the below to work:
Example 1
./src
directory./src/file2.js
and./src/app/file1.js
Observe that only files in
src
are monitored, but not files insrc/app
as Watchpack resolves it to./app/file1.js
.Changing the watch directory to the project root
./
fixes this, but is not always an option.Example 2
A similar example can be presented for the
ignore
filter../
directory and set an ignore filter to ignore everything except files / folders starting with the path./src
./src/file2.js
and./src/app/file1.js
Observe that only files in
src
are monitored, but not files insrc/app
as the Watchpack 'ignored' filter exposes thepathname
as the resolved path of./app/file1.js
instead of./src/app/file1.js
What is motivation or use case for adding/changing the behavior?
Users should be able to use watchpack with symlinks without having to depend on detailed knownledge of the final symlink resolve path.
How should this be implemented in your opinion?
A potential non-breaking direction is to providing an new option
followSymlinksPreservePath
that would not use theLinkResolver
but instead changesfs.lstat
tofs.stat
inDirectoryWatcher.js
to transparently resolve symlinks and watch nested files without changing the paths:watchpack/lib/DirectoryWatcher.js
Line 395 in dc690bb
Are you willing to work on this yourself?
yes
The text was updated successfully, but these errors were encountered: