---
title: "What We Learned Migrating From Webpack to Vite"
description: "Neon moved its console, a set of SPAs whose HTML is rendered by a Go backend, from webpack to Vite."
url: "https://swe.quest/articles/what-we-learned-migrating-from-webpack-to-vite-14623bb3ac0e8ed2"
canonical: "https://neon.com/blog/from-webpack-to-vite"
source: "Neon"
published: "2024-11-20"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["frontend","build-systems","developer-productivity","javascript"]
---

# What We Learned Migrating From Webpack to Vite

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-11-20, 5 min read, Case study. Original: [https://neon.com/blog/from-webpack-to-vite](https://neon.com/blog/from-webpack-to-vite)

## Summary

Neon moved its console, a set of SPAs whose HTML is rendered by a Go backend, from webpack to Vite. Because the backend generates the HTML, they built a ~150-line custom proxy on Vite's JS API and http-proxy that swaps production asset tags (marked with HTML comments) for Vite dev imports to enable HMR, while E2E tests bypass the proxy and use production bundles. Build time did not improve (20s to 22s) and cold dev page loads got slower (~1500 files), but the migration removed 17 direct dependencies, added HMR and unified config with Vitest and Storybook. Gotchas included the SWC React plugin panicking on syntax errors, CSS preload errors in production, entry-point name clashes with API routes, CSP adjustments for Vite's WebSocket and undefined process.env.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [Developer productivity](https://swe.quest/tags/developer-productivity.md) (Engineering practices)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)

## Prerequisites

- JavaScript bundlers ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- hot module replacement
- single-page applications

## Keywords

Vite, webpack, http-proxy, Vitest, Storybook, Neon Console, CloudFront

## Related posts

- [Why We Switched From Webpack To Vite](https://swe.quest/articles/why-we-switched-from-webpack-to-vite-bb748200f241985c.md): Replit · 2021-04-28 · Easy · 2 min read · Build systems, Frontend, JavaScript, React, Developer productivity
  Replit rebuilt its React template on Vite instead of Create React App and Webpack, and it starts far faster: Vite was running before the old container had even booted the CRA files.
- [Optimizing Our Build Times by Migrating from Webpack to Rspack](https://swe.quest/articles/optimizing-our-build-times-by-migrating-from-webpack-to-rspack-0081a00fe51c01d6.md): Yelp Engineering · 2026-05-20 · Medium · 6 min read · Build systems, JavaScript, Frontend, Performance engineering, Refactoring & migrations
  Yelp moved its JavaScript monorepo builds from Webpack to Rspack and cut integration build time by about 52% on average.
- [Best-in-Class Developer Experience with Vite and Hydrogen](https://swe.quest/articles/best-in-class-developer-experience-with-vite-and-hydrogen-71158a029a23fe79.md): Shopify Engineering · 2022-03-31 · Easy · 8 min read · Build systems, Frontend, React, JavaScript, Developer productivity
  Shopify's Hydrogen storefront framework is built on Vite. Vite serves user code as native ES Modules and pre-bundles and caches only third-party dependencies, which speeds up dev-server startup and hot module replacement compared with bundle-based tools like Webpack.
- [Fresh 2.0 Graduates to Beta, Adds Vite Support](https://swe.quest/articles/fresh-2-0-graduates-to-beta-adds-vite-support-98975c3541d22bf3.md): Deno · 2025-09-02 · Easy · 3 min read · Frontend, JavaScript, Build systems, Performance engineering
  Fresh 2.0 enters beta after 63 alphas with a stable architecture, and its final major change is an optional Vite plugin built on Vite's Environment API.
- [Moving Railway's Frontend Off Next.js](https://swe.quest/articles/moving-railway-s-frontend-off-next-js-a0f8a20e0dc7a7ef.md): Railway · 2026-04-03 · Medium · 5 min read · Frontend, React, Refactoring & migrations, Build systems, CDN & edge
  Railway migrated its entire production frontend (dashboard, canvas, marketing site, 200+ routes) from the Next.js Pages Router to Vite + TanStack Router/Start in two PRs with zero downtime.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
