oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.21k stars 2.77k forks source link

Support ignoring paths with `bun --watch` #3398

Open huseeiin opened 1 year ago

huseeiin commented 1 year ago

What is the problem this feature would solve?

nodemon does something like this:

{
    "watch": ["./**/*.ts"]
    // anything other than **/*.ts is supposed to be ignored.
}

tsx (https://github.com/esbuild-kit/tsx) does tsx watch --ignore ./file.js

how to do this with bun?

What is the feature you are proposing to solve the problem?

bun --watch --ignore clientCode/*/

The issue would probably be what would bun do if a certain ignored module is being used during runtime?

What alternatives have you considered?

To completely stop bun from watching files

huseeiin commented 3 months ago

related #5278

mlshv commented 2 months ago

I think this should be prioritized. Not being able to ignore certain paths makes it impossible (or at least very difficult) to implement watch in full-stack apps. For example, it breaks compatibility with Vite HMR, as stated in #13203.

Related: #5278