Skip to content

Commit

Permalink
fix: use server.perEnvironmentStartEndDuringDev
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Nov 1, 2024
1 parent d002e7d commit 44d5282
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/node/server/pluginContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,15 @@ class EnvironmentPluginContainer {
return
}
this._started = true
const config = this.environment.getTopLevelConfig()
this._buildStartPromise = this.handleHookPromise(
this.hookParallel(
'buildStart',
(plugin) => this._getPluginContext(plugin),
() => [this.options as NormalizedInputOptions],
(plugin) =>
this.environment.name === 'client' ||
config.server.perEnvironmentStartEndDuringDev ||
plugin.perEnvironmentStartEndDuringDev === true,
),
) as Promise<void>
Expand Down Expand Up @@ -512,13 +514,15 @@ class EnvironmentPluginContainer {
if (this._closed) return
this._closed = true
await Promise.allSettled(Array.from(this._processesing))
const config = this.environment.getTopLevelConfig()
await this.hookParallel(
'buildEnd',
(plugin) => this._getPluginContext(plugin),
() => [],
(plugin) =>
this.environment.name === 'client' ||
plugin.perEnvironmentStartEndDuringDev !== true,
config.server.perEnvironmentStartEndDuringDev ||
plugin.perEnvironmentStartEndDuringDev === true,
)
await this.hookParallel(
'closeBundle',
Expand Down

0 comments on commit 44d5282

Please sign in to comment.