The Web Development Podcast with Fexingo: Frontend, Backend, and Modern Web Stack

Why Your Webpack HMR Is Rebuilding Everything on Every Save


Listen Later

Episode 68 of The Web Development Podcast dives into a maddening developer experience problem: your Webpack HMR rebuilds the entire bundle on every save when it should only update the changed module. Lucas and Luna trace the root cause to module graph fragmentation from misconfigured `module.rules`, excessive `resolve.alias` entries, and side-effect flags that cascade invalidations. They walk through a real scenario where a 200-line React component triggered a 12-second full rebuild, and how fixing the `sideEffects` field in `package.json` plus scoping loaders to `oneOf` cut it to 400 milliseconds. The episode also covers why the behavior is more visible in Webpack 5 with persistent caching, and when it might be time to consider Vite or Turbopack for large monorepos. Practical diagnosis steps and config diffs included.

#Webpack #HMR #HotModuleReplacement #WebDevelopment #Frontend #BuildPerformance #DeveloperExperience #React #ModuleGraph #SideEffects #PersistentCaching #Vite #Turbopack #Monorepo #WebpackConfig #BundleOptimization #FexingoBusiness #BusinessPodcast

Keep every episode free: buymeacoffee.com/fexingo

...more
View all episodesView all episodes
Download on the App Store

The Web Development Podcast with Fexingo: Frontend, Backend, and Modern Web StackBy Fexingo