40% faster cold boots and 28% faster builds In the latest version of Next.js , we've made improvements to optimize package imports, improving both local dev performance and production cold starts, when using large icon or component libraries or other dependencies that re-export hundreds or thousands of modules. This post explains why this change was needed, how we've iterated towards our current solution, and what performance improvements we've seen. Link to heading What is a barrel file? A barrel file in JavaScript is a way to group and export multiple modules from a single file. It allows for easier importing of the grouped modules by providing a centralized location to access them. For example, let's say we have three modules ( module1.js , module2.js , module3.js ) within a utils/ directory.…