Skip to content
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 files to be watched #181

Closed
bmaupin opened this issue Feb 3, 2023 · 2 comments · Fixed by #625
Closed

Add files to be watched #181

bmaupin opened this issue Feb 3, 2023 · 2 comments · Fixed by #625

Comments

@bmaupin
Copy link

bmaupin commented Feb 3, 2023

Feature request

I would like to be able to add files to be watched in addition to the default, for example to watch the .env file.

Why?

I use a .env file with dotenv for environment variables. Often I'll change a value in .env during runtime to test something (e.g. enable/disable feature flag).

With nodemon I'm using:

nodemon --watch src --watch .env src/index.ts

It would be nice to be able to do this with tsx as well.

Alternatives

My current alternative is nodemon+ts-node+swc. But tsx seems like a more convenient all-in-one solution.

Additional context

No response

@clearly-outsane
Copy link

Any ideas on how to add this? I can help

thewilkybarkid added a commit to PREreview/coar-notify that referenced this issue Dec 18, 2023
This change restarts the server when a file changes.

Note it doesn't pick up changes to the .env file, as tsx doesn't have a way to watch arbitrary files.

Refs privatenumber/tsx#181
thewilkybarkid added a commit to PREreview/prereview.org that referenced this issue Jun 13, 2024
This change replaces ts-node-dev with tsx.

Note that tsx can't watch arbitrary files, so changes to the local .env no longer restart the server.

Refs #1750 wclr/ts-node-dev#312, privatenumber/tsx#181
NamesMT added a commit to NamesMT/starter-fullstack that referenced this issue Jun 22, 2024
Currently contains a hacky workaround, waiting for privatenumber/tsx#181
@privatenumber
Copy link
Owner

This issue is now resolved in v4.18.0.

If you're able to, your sponsorship would be very much appreciated.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants