fix(vite): ensure plugins are only instantiated once (#3450)

This makes debugging a lot easier as by default vite instantiates
plugins multiple times for each environment.
This commit is contained in:
Marvin Hagemeister
2025-09-16 11:35:00 +02:00
committed by GitHub
parent b9d550fef8
commit 9a2098ecba
11 changed files with 16 additions and 0 deletions
@@ -15,6 +15,7 @@ export function clientSnapshot(options: ResolvedFreshViteConfig): Plugin[] {
return [
{
name: "fresh:client-snapshot",
sharedDuringBuild: true,
applyToEnvironment(env) {
return env.name === "client";
},
@@ -142,6 +143,7 @@ if (import.meta.hot) {
},
{
name: "fresh:client-island",
sharedDuringBuild: true,
resolveId: {
filter: {
id: /^fresh-client-island::/,