bun
bun copied to clipboard
Add support for `--watch`
What is the problem this feature will solve?
Node.js added support for node --watch in v18. --watch is common among other developer tools, so we should support it as well.
This is different than --hot, because --watch reloads the process, while --hot does not.
What is the feature you are proposing to solve the problem?
See https://github.com/oven-sh/bun/issues/1356#issuecomment-1284594045
What alternatives have you considered?
No response
It's not exactly the same thing
--hotmeans "reload the code without restarting the process"--watchmeans "restart the process on change"
This sounds like a distinction without a difference but it impacts how people expect it to work.
I think Bun should potentially support both hot reloading and live reload, especially for tests. HMR for tests don't make much sense - you want a clean state before each run.
I think another option is to say "Did you mean --hot"? When they try "--reload" and it doesn't do anything
This is implemented in v0.5.9 isn't it?
Yes, this has been implemented.
Trying either bun --hot run dev.tsx, bun --watch run dev.tsx does not do anything when modifying App.tsx and reloading (Command + R) in bun v.0.7.3.