NewsCrawler.org

Switching the build tool to Rust for 30x speed nearly overloaded the team

The author led a move of his team's build tool from Webpack to Rspack[1] at the end of 2025. Cold build time dropped from 45 seconds to 2 seconds, and the official benchmark claimed about 20x faster performance.

A week later, an urgent release failed to build. An old page contained `@media and(max-width: 768px)` with a missing space. Webpack's compressor ignored this, but Lightning CSS[2], which Rspack uses underneath, rejected it as invalid syntax. Separately, a dynamic import in another module silently stopped rendering components, and finding the cause took a full day: an old dependency's default export behaved differently under Rspack's stricter rules.

The author argues that a faster compiler does not remove the causes of slow builds, such as duplicate polyfills, ineffective Tree-Shaking[3], conflicting plugins and unused loaders. Rust tools also make debugging harder, and a custom Webpack loader may have no equivalent in Rspack. After Vite 8 switched to Rolldown[4], the /@/ path alias broke in the config loader, the object form of manualChunks was removed, and some Rollup hooks and legacy plugins stopped working. The author now advises switching only after technical debt is cleaned up, and postponing the move if many configs work for unknown reasons or no one on the team understands the build chain.

Read the original juejin.cn

Discussion

One commenter reports migrating from Webpack to Rspack quickly with Claude Code, hitting only one UMD compilation problem and finding the build much faster.

Sources

  • CNJuejin ZH

    为了快 30 倍,我把构建工具换成了 Rust,结果团队差点连班都加不了

    16 likes1,249 views4 comments10 saves

Published: First seen: Читать по-русски

Open as a page