-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Support for watching hidden files #210
Comments
This comment was marked as spam.
This comment was marked as spam.
@privatenumber should also work for includes like
One possible implementation is via regexp checking of included items:
Given that tsx only watches imported sources and explicitly included files, there's a question if ignoring dotfiles and dotdirs has a real use case at all I can help implementing that |
Nice, thanks. I looked into implementation but I'm not far into it at all so feel free to tackle it if you have time. Regarding implementation, I was planning to convert the ignore in chokidar to a function and test against any |
@privatenumber good, looked into it a bit. Currently, chokidar watch ignored option supports anymatch Also, the chokidar The evaluation rules for any added files would be:
I can get to it later this week. WDYT? |
@iki Great insight and that sounds good, thanks for looking into it! Also, not too relevant right now, but FYI I'm considering migrating from chokidar to @parcel/watcher down the road. It's used by VSCode and seems to support more platforms. But as you point out, tsx only watches specific file paths, so maybe we can even just use |
This comment was marked as spam.
This comment was marked as spam.
Would it be possible to add a note to the documentation that using --include with a hidden file does currently not work as long as this is not implented? :) |
Feature request
Allows monitoring changes starting with
.
, like.env
or other hidden files.Why?
Reading hidden files in ts files is a special requirement we encounter in business development.
For example, we will keep some secret data locally on the server by means of hidden files. When adjusting the content of hidden files, the result should also be real-time refresh, but tsx excludes hidden files from the monitoring range by default, which will not meet this requirement.
For the same case, please refer to #181
Alternatives
In order to meet such requirements, it is necessary to add the monitoring capability of dependent files other than js/ts first, like the capabilities provided by #208.
Then exclude rules that match the currently watched file from the default ignored rules. For example, if I watch
.env
file,**/.*
should be removed from the ignored rules, as shown in the figure below.Additional context
The text was updated successfully, but these errors were encountered: