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.