CRA-to-Vite Migration Behind a Shadow Build

The app worked, and everyone was scared to touch it: both builds ran in parallel through the transition, dependencies climbed a risk ladder in separate PRs, and the cutover flipped behind a feature flag that swings both ways.

CRA-to-Vite Migration Behind a Shadow Build

About the client

A mid-market company running a customer-facing React single-page application that carries core workflows for its users

Product

The app was built six years back on Create React App and Webpack; the original team had moved on, and the engineers still around treated the frontend like a basement with the lights out. Security scanners flagged dozens of vulnerabilities in aging dependencies. Production builds took nine minutes, and every attempt to upgrade React or a major library died in a pile of breaking changes that sat unowned. The company had zero senior frontend architects on staff, and the product roadmap kept moving regardless.

A controlled migration delivered as staged pull requests. A parallel Vite build stood up beside the Webpack build, both producing a working application through the whole transition. Dependencies climbed a risk ladder group by group, custom Webpack loaders were replaced with Vite equivalents or isolated behind compatibility layers, and the cutover flipped behind a feature flag with a staged rollout. The client’s own engineers kept shipping product features in the same repo throughout.

“Six years of product lived in that app, and the people who built it lived elsewhere. My team kept shipping features around the edges, slow and careful, like carrying glass across a tile floor. Devox staged the migration in layers with a shadow build proving parity at every step, and the cutover flipped behind a flag. Our roadmap kept rolling the whole time, and the week after the switch my engineers opened the config themselves.” — Vice President of Engineering at the client.

Tech Stack

Build and CI/CD technologies: a shadow Vite configuration running beside the existing Webpack setup in CI; a bundler-parity harness diffing the two builds across critical screens; a dependency risk ladder with per-group checkpoints; compatibility layers for custom Webpack loaders and plugins; feature-flag rollout with staged traffic; a tech-debt ledger for packages kept at older versions with revisit dates.

Front-end technologies: Vite and the React toolchain aligned to it; TypeScript and ESLint and testing-library versions synchronized to the new build; smoke suites covering login and primary forms and paginated lists.

Intro

The engagement opened the Devox way, a paid discovery sprint: two weeks auditing the dependency tree and the vulnerability report and the build graph, plus baselines for build time and CI spend and PR cycle time, plus a signed attribution rule. The discovery produced the map of where the bodies were buried: which loaders mattered; which routes carried the traffic; which upgrades had safe migration paths. The scoreboard existed before the build began.

Challenges

  • A HAUNTED CODEBASE

The app worked, and everyone treated it accordingly: leave it alone. The original architects had left the company, and their tribal knowledge left with them. Each pull request required some archaeology before any code could be written, and senior product engineers spent their time and effort avoiding the frontend instead of improving it.

  • THE BUILD TAX

Production builds ran nine minutes, and the dev server cold start took long enough for a coffee run. Engineers batched their changes to dodge the queue, which made every diff bigger and riskier than it needed to be. The CI bill tracked the waste in dollars, and PR reviews dragged past a day while the queue chewed.

  • RED BADGES, STUCK DEALS

Security scanners reported sixty-one high- and critical-severity findings across the aging dependency tree, and every attempt to upgrade React or a major library produced breaking changes that sat unowned. Enterprise buyers conducted security reviews during procurement, and two of them stalled because of the reported findings while the engineering team watched the deals cool.

Solution

Two builds, one truth. A shadow Vite configuration stood up beside the incumbent Webpack build, and both produced a working application through the entire transition. A parity harness diffed the two bundles across the critical paths: authentication and the main data flows, and the high-traffic screens. Evidence replaced opinion at every step of the argument, and the migration earned trust screen by screen.

The risk ladder. Dependencies were split into risk groups and upgraded one group per PR series, each landing with a checkpoint. Security first: packages flagged high or critical with a non-breaking upgrade path. Tooling second: TypeScript and ESLint and testing-library aligned to Vite. React and its router third, in small jumps rather than one leap. UI and state and utility libraries fourth, a group at a time, with any package requiring a disruptive major upgrade kept at its existing version and written into the debt ledger with a revisit date. Each package had a safe upgrade path, or it stayed put; upgrades and business-logic changes lived in separate pull requests by rule.

Loaders behind glass. Custom Webpack loaders and plugins were replaced with Vite equivalents where equivalents existed and isolated behind compatibility layers where they were needed. Business logic stayed untouched through the whole engagement. The cleanup phase retired the CRA leftovers, react-scripts and stale configs and dead polyfills, and the scream test decided what else could go: switch the piece off and see who hollers.

A two-way door. The cutover ran behind a feature flag with a staged rollout: a tenth of the traffic for a week, then everyone. Any regression could trigger a rollback through the feature flag, so a rollback meant flipping a switch instead of redeploying the previous artifact. The dress rehearsal ran in staging with the parity harness scoring both builds one final time.

Tests where the risk lives. The existing automated suites ran against the Vite build from day one. Coverage gaps were filled only on the critical paths the migration itself touched, which kept the test effort proportional to the actual risk instead of spreading QA thin across the whole app.

The advisor layer as a debt ledger. Devox engineers logged improvement proposals with projected effects and client decisions and status on every line: nineteen proposals through the engagement, from loader retirement to CI cache tuning. Thirteen were adopted, and the debt ledger with its revisit dates became the client’s own mechanism for tracking technical debt, with two client engineers running it week to week.

The AI layer. Routine tasks were handled through the Devox AI Accelerator: drafted breaking-change briefs for each package on the ladder; first-pass migration notes for the config work; smoke-check drafts for the critical paths. A human engineer confirmed every brief, and sign-off was recorded in the ledger alongside the approved drafts.

“A codebase gets scary the way a basement does: the lights went out when the last architect left, and everyone stopped going down the stairs. We kept both builds alive and let the parity data argue for us, which turned the cutover into a two-way door instead of a leap. Small PRs with a checkpoint on every rung beat a big bang every day of the week.” — Frontend Platform Practice Lead, Devox Software.

Results

Measured against the discovery baseline, working on the app went from intimidating to routine: Production builds fell from nine minutes to thirty-eight seconds, a 93% cut, and the dev server cold start dropped from three and a half minutes to under a second. High and critical vulnerability findings fell from sixty-one to five once the aging transitive dependencies left the tree. The staged rollout ran clean: a tenth of traffic for a week and then everyone, with zero regression tickets tied to the migration in the first thirty days. The client’s internal team shipped twenty-three product releases during the fourteen-week engagement, and the first React upgrade attempted after the migration landed in three days, whereas the year prior a similar attempt had failed after six weeks of dealing with breaking changes. Two stalled enterprise security reviews cleared once the findings report shrank.

Business Outcomes

  • The roadmap stayed whole. Twenty-three product releases shipped during the fourteen-week migration, with the client’s own engineers working the same repo the whole time.
  • The build tax was repealed. Build time fell 93% and CI spend dropped from $2,300 a month to $640, and PR cycle time fell to under a day.
  • Deals unstuck. Two enterprise security reviews cleared procurement after the findings count fell from sixty-one to five, a 92% cut.
  • Upgrades became Tuesday work. The first post-migration React upgrade shipped in three days, and later library bumps ran as routine PRs instead of quarter-eating projects.
  • Advisory returns, auditable. Nineteen proposals in the improvement log with thirteen adopted, 68% adoption, and $164K in annualized realized savings under the signed attribution rule.

Technical Outcomes

  • Shadow build, proven parity. Both Webpack and Vite produced working applications through the transition, with a bundler-parity harness diffing authentication and main data flows and high-traffic screens.
  • A risk ladder with checkpoints. Dependencies upgraded in staged groups with a checkpoint per rung, and upgrades kept separate from business-logic changes in every PR.
  • Compatibility layers for the odd parts. Loaders and plugins were replaced with Vite equivalents or stayed isolated, keeping business logic untouched the entire run.
  • A two-way cutover. Feature flag and staged rollout, reversible at the switch, with the previous artifact standing by untouched.
  • Tests proportional to risk. Existing suites ran against the Vite build continuously, with coverage gaps addressed only on critical paths touched by the migration.
  • A debt ledger with scheduled reviews. Packages parked on old versions carry revisit dates, and the cleanup retired react-scripts and stale configs and dead polyfills.

Summary

Ask the team what changed and the answer comes back the same: working on the app went from intimidating to routine, and touching it became Tuesday work instead of archaeology. The builds got fast; the badges got quiet; the engineers who stayed got their codebase back.

The engagement closed with the pattern intact by design:

  • The paid discovery fixed build baselines and vulnerability counts and the attribution rule before the work.
  • The shadow build turned the cutover into a two-way door with parity evidence on every screen.
  • The advisor log left a debt ledger with revisit dates, with 68% of the proposals adopted.
  • The AI Accelerator integrated routine drafting tasks into operations, measured in review prep hours and upgrade days.

The same pattern applies at any shop sitting on a working app everyone is scared to touch: CRA survivors or Webpack veterans or config hairballs of any vintage.

Book a call

Want to Achieve Your Goals? Book Your Call Now!

Having trouble booking? Open the booking page.

Contact Us

We Fix, Transform, and Skyrocket Your Software.

Tell us where your system needs help — we’ll show you how to move forward with clarity and speed. From architecture to launch — we’re your engineering partner.

Book your free consultation. We’ll help you move faster, and smarter.

Let's Discuss Your Project!

Share the details of your project – like scope or business challenges. Our team will carefully study them and then we’ll figure out the next move together.







    By sending this form I confirm that I have read and accept the Privacy Policy

    Thank You for Contacting Us!

    We appreciate you reaching out. Your message has been received, and a member of our team will get back to you within 24 hours.

    In the meantime, feel free to follow our social.


      Thank You for Subscribing!

      Welcome to the Devox Software community! We're excited to have you on board. You'll now receive the latest industry insights, company news, and exclusive updates straight to your inbox.