All work

Webpack 5 to Rspack

From a minute to under a second: moving a huge frontend to Rspack

I set up this frontend's Webpack 5 build years ago, and it stayed reliable while the app grew to several thousand components and several hundred pages. It had also become slow. I made the call to move it to Rspack and delivered the whole migration myself, for local development and production, without a single material issue.

My part

  • Initiated and decided
  • Designed and built the migration
  • Rolled it out to the team

The numbers

  • Dev server start60× fasterEvery morning, and after every branch switch

    Webpack
    ~1 min
    Rspack
    0.5–1 s
  • Cloud production build6× fasterEvery release, and every pipeline run

    Webpack
    ~6 min
    Rspack
    < 1 min
  • Rebuild after every change0.5–1 s
  • Local production build6–10 s
  • Cloud build cost~85% lower

Why move

Nothing was broken. The Webpack setup I'd built had been stable for years. This was about speed: starting the dev server could take close to a minute, and production builds in the cloud took four to six.

That kind of wait is easy to stop noticing, and the whole team paid it every day. Nobody asked for this migration. I saw the cost and decided to fix it.

Choosing Rspack

I'd already tried Vite on this app. It was fast up to a point, but not at this app's scale. Rspack's close compatibility with Webpack meant years of existing behavior could come across intact, and at this size it was both faster and dependable.

A mature app doesn't move over untouched. This one needed custom handling for its web workers, its SCSS processing and its cloud-build caching, and I built all of it.

Rollout

The old build was reliable, so the new one had to prove it was too before it replaced it.

  1. 01

    Run both

    Webpack and Rspack stayed available side by side for about a week.

  2. 02

    Watch

    I watched for failures and for complaints from engineers on the new setup. Nothing material came up.

  3. 03

    Switch and remove

    Rspack became the release setup, and the Webpack setup was deleted.

What changed

Dev startup is 60× faster. Change a file and it's in the browser almost instantly, on first boot and on every edit after. Cloud builds finish in under a minute and cost a fraction of what they did. It's now the standard setup for the whole frontend team and the production pipeline.