Vercel
Vercel logoVercel · Feature trail

Package Import Optimization

1 post · Oct 2023

What this trail covers

Vercel's Next.js has introduced `optimizePackageImports` to automatically optimize package imports, addressing performance issues caused by barrel files. This feature analyzes package entry points to directly import modules, bypassing the overhead of barrel files. It offers significant improvements in local development speed, production build times, and faster cold starts in serverless environments. The system also handles recursive barrel files and is pre-configured for common libraries, with potential for automatic opt-in in the future.

All Vercel trails