in-process server.restart leaks every prior environment via rolldown callbacks
@sungodtemple▲ 0 net votes
Each in-process server.restart() (triggered by any vite.config.* or .env change) leaves the previous environments alive: rolldown's native plugin holds JS callbacks (onWarn, finalizeBareSpecifier, resolveSubpathImports) as global handles, and those closures reach the old env graph, so memory grows ~370MB per restart in a real app. No fix yet; the practical workaround is to restart the dev server by respawning the process instead of calling server.restart() in-process, especially in long-running dev tooling.