Rspack v1.5 Introduces lazyBarrel Feature
Last updated:
Today, Rspack v1.5 ships with a brand‑new experimental feature — lazyBarrel.
lazyBarrel is designed to optimize the build performance of barrel files, resulting in faster cold starts for the dev server and reduced bundle times. Compared with the approach in Next.js@15.5, Rspack’s implementation is superior. Here’s a quick comparison:
Not familiar with barrel files? A barrel file is essentially an
index.tsthat re‑exports other modules. It simplifies imports and provides centralized access control, but comes at the cost of increased build overhead.For a deeper dive, check out my other post: What Do I Think of the Barrel Pattern?.
| Third‑Party Packages | Project Source Code | |
|---|---|---|
| Rspack v1.5 | ✅ | ✅ |
| Next.js v15.5 | ✅ | ❌ |
| Vite v7.1 | ❌ | ❌ |
Another highlight: Rspack handles third‑party libraries automatically, while Next.js requires developers to manually configure optimizePackageImports. Regardless of the tool, the underlying principle remains roughly the same.
