How I Slashed a Legacy Build from 4.5 Minutes to 8 Seconds — and Got Away with It
This story shows that massive build performance gains are often achievable with existing tools and a weekend's work — no formal project approval needed. For Western developers, it's a reminder that the biggest bottlenecks (like transpiling node_modules) are universal, and that tools like Rspack offer a low-risk, high-reward migration path from Webpack. It also highlights the cultural and practical dynamics of "underground refactoring" in a team setting.
A developer at a Chinese company was fed up with a three-year-old React project that took 4 minutes and 30 seconds to build. Over a single weekend, they profiled the build, discovered babel-loader was transpiling node_modules, and applied a series of optimizations: tightening loader include paths, separating TypeScript type checking into a child process with fork-ts-checker, and enabling Webpack 5's filesystem cache. These changes alone cut the build to 38 seconds.
But the developer didn't stop there. They then migrated the local development config to Rspack, a Rust-based Webpack-compatible bundler from ByteDance, achieving an 8-second cold build. The CI pipeline, however, remained on the optimized Webpack 5 config. The developer committed the change under a vague PR title, and soon other teams noticed the speedup and started asking for the config. This led to an impromptu knowledge-sharing meeting where the full story — including the incomplete CI migration — came out.
The outcome: the developer's own team now builds in 8-15 seconds, three other teams adopted variations of the approach, and the Jira ticket remained at 2 story points. The story is a case study in the power of individual initiative, the risks of undocumented weekend refactors, and the viral effect of visible performance gains.
The biggest single gain came from fixing a basic misconfiguration (transpiling node_modules) — a reminder that profiling before optimizing is non-negotiable.
The developer's decision to migrate to Rspack without telling anyone is a high-risk, high-reward move that paid off, but it created a documentation and support burden.
The story reveals a cultural pattern: individual engineers often drive significant technical improvements outside formal processes, then retroactively justify them.
The viral spread of the config across teams shows that visible performance wins are the best marketing for internal tooling changes.
The developer's reluctance to fully switch CI to Rspack (due to an untested plugin bug) is a realistic example of the gap between local dev and production readiness.