Context
We switched the frontend dev server to Vite in July 2025 (PR #35247), but production builds still go through a custom esbuild pipeline (frontend/build.mjs + @posthog/esbuilder). That means two separate build systems with different configs, different behavior, and different bugs.
Goal
Use Vite as the single build tool for both development and production.
Scope / ideas
- Audit what the esbuild pipeline does beyond bundling — multi-entry-point builds (index, exporter, render-query, toolbar), metadata generation, parallel build orchestration
- Set up a Vite production build and validate output against current esbuild output (bundle size, chunking, etc.)
- Replace esbuild prod config with Vite
- Verify CI pipelines and deploy still work with the new build
Current state
Open questions
- Why were the previous Vite prod PRs abandoned? Blockers worth understanding before another attempt.
References
Context
We switched the frontend dev server to Vite in July 2025 (PR #35247), but production builds still go through a custom esbuild pipeline (
frontend/build.mjs+@posthog/esbuilder). That means two separate build systems with different configs, different behavior, and different bugs.Goal
Use Vite as the single build tool for both development and production.
Scope / ideas
Current state
frontend/vite.config.ts), esbuild 0.25.x for prod (frontend/build.mjs,common/esbuilder/utils.mjs)POSTHOG_USE_VITE_PROD=1(PRs chore(devex): vite feature parity in building for production (with CI) #40432, chore(devex): vite feature parity in building for production #40431, Oct 2025) — both were closed without merging, marked WIPOpen questions
References