YelpBenson Pan, Software EngineerProblem & solution
Optimizing Our Build Times by Migrating from Webpack to Rspack
Summary
As Yelp's JavaScript monorepo expanded over time, Webpack build speeds became a significant engineering bottleneck. To resolve this without rewriting complex configurations, the team selected Rspack for its direct compatibility with existing Webpack setups and plugins. Yelp implemented an adapter pattern to generate Rspack configurations dynamically from original Webpack files, enabling a staged opt-in rollout across development tools and CI environments. Following the initial migration, engineers addressed performance issues in barrel files using automated codemods to replace star re-exports and import-then-export patterns with named re-exports. Combined with Rspack's portable persistent caching, the migration reduced integration build times by approximately 52 percent and warm cache builds by up to 80 percent.
Context
Webpack build speeds became a major bottleneck as Yelp's JavaScript monorepo continued to grow. Prior incremental optimizations reached their limit, requiring a more substantial solution without the friction of migrating away from Webpack-compatible configuration patterns.
Approach / What changed
Yelp transitioned to Rspack using an adapter pattern that derived Rspack configurations from existing Webpack files while preserving original settings. The team conducted a staged rollout with opt-in flags for developer tooling and CI, resolved tree-shaking blockers in barrel files via codemods, enabled Rspack portable persistent caching, and configured Storybook by clearing default Rsbuild rules.
Takeaways
An adapter pattern allowed Yelp to dynamically generate Rspack configs from existing Webpack files, preserving original settings and enabling a staged rollout.
Automated codemods converting star re-exports and import-then-export patterns into true named re-exports fixed tree-shaking and barrel file performance issues.
Rspack portable persistent cache solved Webpack absolute-path CI limitations, yielding up to an 80 percent reduction in build times on warm caches.
Source and freshness
- Source
- engineeringblog.yelp.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.