Home / Companies / Neon / Blog / Post Details
Content Deep Dive

What We Learned Migrating From Webpack to Vite

Blog post from Neon

Post Details
Company
Date Published
Author
Roman Zaynetdinov
Word Count
1,284
Language
English
Hacker News Points
-
Summary

Neon, a serverless Postgres platform, transitioned from using Webpack to Vite for building its Single Page Applications (SPAs) to improve simplicity and efficiency. The migration aimed to support hot module replacement (HMR), improve build times, and reduce dependencies. While the build times with Vite initially did not improve and even slightly increased, the setup became significantly simpler, and the HMR functionality was a notable advantage. A custom Vite proxy was developed to integrate with the backend's dynamic HTML generation, allowing developers to interact with an HMR-enabled app. Despite challenges such as resolving conflicts with API endpoints and issues with the @vitejs/plugin-react-swc extension, the migration unified tooling across apps and improved the development experience. Additionally, patching the Ace Editor dependency reduced the number of modules processed by Vite, speeding up build times by approximately 50%.