Package Import Optimization
How we optimized package imports in Next.js

How we optimized package imports in Next.js

10/13/2023

What this post added

Introduced `optimizePackageImports` in Next.js 13.5 to automatically optimize package imports by analyzing barrel files and directly importing modules. This replaces the manual `modularizeImports` configuration and offers significant performance gains in local development, production builds, and cold starts. The feature recursively handles barrel files and includes pre-configurations for popular libraries.

Read the original post ↗