From 42ed65fbb98fc862bbbbb219abfd3271b6ce0286 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Thu, 5 Dec 2024 14:15:15 +0900 Subject: [PATCH] fix: move initial build from `env.init` to `env.listen` --- packages/vite/src/node/server/environments/rolldown.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vite/src/node/server/environments/rolldown.ts b/packages/vite/src/node/server/environments/rolldown.ts index 9205e4b4aef095..92edbdbba621b1 100644 --- a/packages/vite/src/node/server/environments/rolldown.ts +++ b/packages/vite/src/node/server/environments/rolldown.ts @@ -171,6 +171,10 @@ class RolldownEnvironment extends DevEnvironment { assert(this._pluginContainer) this._pluginContainer.buildStart = async () => {} this._pluginContainer.close = async () => {} + } + + // delay build till listen since some plugins expect `configureServer` before build + override listen: DevEnvironment['listen'] = async () => { await this.build() }