Loading…
Optimizing Our Build Times by Migrating from Webpack to Rspack
YelpBenson Pan, Software Engineer
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.
Related reading
Yelp ·
Beyond the Menu Tree: How Yelp Built a Smarter Customer Success Chatbot with AI
Yelp transitioned from a legacy customer support chatbot that relied on rigid phrase matching and static menus to a retrieval-augmented generation system. The updated architecture classifies incoming queries using a large language model to route users into one of five specialized workflows, including QA, Billing, Refund, Cancel, and Review. For general QA, the system uses FAISS to search an in-memory vectorstore built exclusively from article metadata such as titles, summaries, and headers rather than raw article text. Retrieved articles are supplied to the language model as prompt context, followed by automated validations for safety, character limits, and hallucinated hyperlinks. In production A/B testing, this metadata-driven design doubled the chatbot resolution rate while achieving approximately 94% recall@5.
Lina Lee, Machine Learning Engineer; Nelson Lee, Engineering ManagerYelp ·