#210·tsx

Support for watching hidden files

Author: boxizenCreated Mar 24, 2023Updated Aug 16, 2026
Labelsenhancementwatch

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 https://github.com/esbuild-kit/tsx/issues/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 https://github.com/esbuild-kit/tsx/pull/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