diff --git a/packages/vite/src/node/server/environments/runnableEnvironment.ts b/packages/vite/src/node/server/environments/runnableEnvironment.ts index c47298a22920f6..eaea7e826ca26f 100644 --- a/packages/vite/src/node/server/environments/runnableEnvironment.ts +++ b/packages/vite/src/node/server/environments/runnableEnvironment.ts @@ -57,6 +57,13 @@ class RunnableDevEnvironment extends DevEnvironment { this._runner = createServerModuleRunner(this) return this._runner } + + override async close(): Promise { + await super.close() + if (this._runner) { + this._runner.destroy() + } + } } export type { RunnableDevEnvironment }