rspack icon indicating copy to clipboard operation
rspack copied to clipboard

Watch config file and auto restart on change

Open lsdsjy opened this issue 2 years ago • 3 comments

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

lsdsjy avatar Jun 07 '23 09:06 lsdsjy

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 avatar Jun 07 '23 09:06 hardfist

@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

alexander-akait avatar Jun 07 '23 11:06 alexander-akait

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

th3fallen avatar Jul 28 '23 01:07 th3fallen

The behavior is the same with webpack.

h-a-n-a avatar Jun 25 '24 12:06 h-a-n-a