web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
10.04k stars 573 forks source link

[Feature]: support native watcher #8455

Open hardfist opened 4 days ago

hardfist commented 4 days ago

What problem does this feature solve?

we currently use watchpack and it has performance issue especially when killed by ctrl-c, it may even take seconds to shutdown, we can progressively migrate watchpack to native watchers

What does the proposed API of configuration look like?

experiments: {
   nativeWatcher: true
}

we can reuse Watch and watchOptions

ClSlaid commented 2 days ago

I don't see any native file wather implementation in rspack, is that already done?

If the watcher does not exist, we can implement that with watch-exec