Closed yuyutaotao closed 2 days ago
This issue seems not to be reproduced stably, I tried several times, and can't reproduce it.
I guess it is related to https://github.com/web-infra-dev/rspress/blob/54be7c8b9176bcd92a393289fe5eee88540c744b/packages/cli/src/index.ts#L76-L107, graceful shutdown is something more complicated than we think.
When we modify _meta.json
or shutdown using ctrl + c, the dev server will be restarted, including the steps of restarting webpack dev middleware. When the watched project's node_modules is too large, there is a problem that the close time is particularly long in watchpack maybe.
We can config in rspress.config
like below
builderConfig: {
tools: {
rspack: {
watchOptions: {
ignored: /node_modules/,
},
},
},
},
see https://www.rspack.dev/config/watch#watchoptions
or
we can config tranformImport
to on-demand import.
Version
Details
Reproduce link
-
Reproduce Steps
ctrl + c