rspack
rspack copied to clipboard
Watch config file and auto restart on change
What problem does this feature solve?
When using rspack serve, changes to config file can automatically trigger a restart of dev server (like vite dev).
What does the proposed API of configuration look like?
N/A
related to https://github.com/webpack/webpack-cli/issues/15 there're some blockers on webpack side https://github.com/webpack/webpack-cli/issues/15#issuecomment-1533625016 @alexander-akait any plan for https://github.com/webpack/webpack-cli/issues/15 ?
@hardfist
Yes, this is still in the plans, but unfortunately it's a bit difficult to implement it correctly, vite just restarts everything and not invalidate the dependency graph (for example if you have multi compiler mode and change only one configuration file, you don't need to rebuild all compilations), it's not quite right, but most likely enough for the needs of most. The question is - do we want the correct implementation or just implement this and say we support it, to be honest, the configurations don't change often, so it wasn't a priority
On the topic it would be amazing if we could provide a list of files to the watch config and cause a restart of the dev server if they change like .env files for example
The behavior is the same with webpack.