Home / Companies / LogRocket / Blog / Post Details
Content Deep Dive

webpack or esbuild: Why not both?

Blog post from LogRocket

Post Details
Company
Date Published
Author
John Reilly
Word Count
1,524
Language
-
Hacker News Points
-
Summary

Web development is evolving with the introduction of modern build tools like esbuild, Vite, and swc, which are written in high-performance languages such as Go and Rust, offering faster build speeds compared to traditional tools like webpack and rollup.js. For developers heavily invested in webpack who seek faster builds without undergoing a complete migration, esbuild-loader offers a practical solution by integrating esbuild into webpack setups, allowing for significantly improved build times without abandoning existing infrastructure. This tutorial outlines the steps to replace babel-loader or ts-loader with esbuild-loader in webpack configurations, demonstrating a substantial reduction in build times, evidenced by a case study where build time was reduced from 22.08 seconds to 13.85 seconds. The process involves minor configuration adjustments in projects created with Create React App, using tools like CRACO to maintain compatibility with the evolving Create React App ecosystem while benefiting from esbuild's speed.