---
title: 'Lessons Learned from Migrating Enterprise Apps from Webpack to Vite'
description: 'A retrospective on migrating a 100k+ line codebase to modern ES module-driven tooling.'
subtitle: 'From 90-second cold starts to sub-second hot module replacement.'
date: '2024-04-02'
lang: 'en'
---

Migrating legacy build systems requires meticulous planning, especially when handling non-standard imports, environment variables, and polyfills.

## The Strategy

1. **Audit Dependencies**: Identify packages relying on Node.js globals (`process.env`, `Buffer`).
2. **Alias Cleanliness**: Align TypeScript paths with Vite resolve aliases.
3. **Chunk Strategy**: Fine-tune code splitting using `manualChunks` or Rolldown groups.

The outcome: developer happiness surged, CI pipeline costs dropped, and HMR became instantaneous.
