esbuild
swc
Our great sponsors
- InfluxDB - Access the most powerful time series database as a service
- ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
- CodiumAI - TestGPT | Generating meaningful tests for busy devs
- SonarQube - Static code analysis for 29 languages.
esbuild | swc | |
---|---|---|
300 | 130 | |
35,360 | 27,419 | |
- | 2.3% | |
9.7 | 9.9 | |
10 days ago | 6 days ago | |
Go | Rust | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
esbuild
-
[AskJS] Advantages of Rollup over other bundlers for creating libraries?
Rollup is highly configurable via plugins. It also supports a wide range of transpilation targets. However, it's written in JavaScript (well, TypeScript) so there's a ceiling on how fast it can go. esbuild and swc are orders-of-magnitude faster than Rollup.
-
JavaScript import maps are now supported cross-browser
Note that `deno bundle` is deprecated. You can almost replace it with esbuild but it currently lacks builtin support for import maps:
deno run --allow-all https://deno.land/x/[email protected]/mod.js --bundle app.js --outfile=bundle.js. # errors, see: https://github.com/evanw/esbuild/issues/2230
-
xtsz - a TS / JS file runner with support for HTTP/S imports
Want to import a package / file conveniently from esm.sh or unpkg or directly from a GitHub repo for a one-off script (for example). To do this I created a custom ESBuild plugin to handle HTTP imports - that worked for ,js files. To support running both ESM and CJS, I use tsx.
-
Let’s create a Node CLI for generating files from templates!
esbuild – is an easy-to-configure bundler,
-
Building a modern gRPC-powered microservice using Node.js, Typescript, and Connect
As we iterate on the definition, we are going to want a better developer experience for rebuilding the package on changes. Typically, for a “library” or “utility” style package, I’d reach for either unbuild’s stub concept or use esbuild/tsup/rollup to implement a more traditional watch/rebuild, but in this case, I’m watching a proto file that lives outsides of the source, which breaks assumptions of those tools.
-
Svelte frontend vs HTMX and hyperscript
I use ESBuild (https://esbuild.github.io/) as a library for my almost pure Go toolchain, and it covers my requirements for almost 2 years now. ESBuild is the Go tool used in Vite, an incredible tool that I stopped using when I discovered that ESBuild covered all my needs.
-
Buildless workflow through import maps (featuring Lit, Shoelace and more)
As we can see, we have two external dependencies and one internal tool. In the modern way of packaging our application, we would be of course required to package this project using some bundler like ESBuild or Rollup. But with import maps, we can instead utilize CDN's to deliver our packages and completely eliminate the bundling step.
-
How are you building React applications? It's time to move on from Create React App
"Why?" you might ask. Vite is built on top of esbuild, a Go-based bundler for the web that is 10-100x faster than other bundlers such as webpack. Vite is also platform-agnostic, so you can learn the tool and use it for many applications.
-
The Technology Behind “Moyuk”: Create, Run and Share Tools with TypeScript on Your Browser
Internally, esbuild is used. Esbuild has a plugin system, and I created custom plugins to resolve import statements like npm: and https://.
-
Benchmarking the AWS SDK
The other option I want to highlight is packaging the project using something like Webpack or esbuild. JS Bundlers transpile all of your separate files and classes (along with all node_modules) into one single file, a practice originally developed to reduce package size for frontend applications. This helps improve the cold start time in Lambda, as unimported files can be pruned and the entire handler becomes one file.
swc
-
[AskJS] Advantages of Rollup over other bundlers for creating libraries?
Rollup is highly configurable via plugins. It also supports a wide range of transpilation targets. However, it's written in JavaScript (well, TypeScript) so there's a ceiling on how fast it can go. esbuild and swc are orders-of-magnitude faster than Rollup.
-
Optimize your Bundle Size with SWC and GraphQL Codegen
There was already a Babel plugin for the client-preset for projects using Babel in the client-preset package. Now, as SWC itself, and Next.js is becoming more popular and uses SWC as its default compiler, there was a need for a SWC plugin as well. SWC is a fast and modern JavaScript/TypeScript compiler written in Rust, so the Babel plugin couldn't be used.
-
What are some stuff that Rust isn't good at?
MyPy and tsc on the other hand? Please make a Ruff for MyPy and hurry up and fund the author of SWC to develop STC. I'm tired of waiting several seconds after each :w for my quickcheck window to update.
-
[Blog post]: Scaling Rust builds with Bazel
I've been thinking this too time to time and tried to apply some poc to one of the codebase (https://github.com/swc-project/swc) but wasn't able to make notable progress. There were couple of reasons and curious how you could solve it.
- No one cares about Bun's speed. Your CI does though
- You don't say
-
How Rust went from a side project to the world's most-loved programming language
Rust's niche is speed and reliability, which means being pretty good at many domains. That might sound like it can be replaced, but not actually. Let's take an example of a developer tool - ruff. It's a linter for Python that aims to replace a bunch of tools written in Python - Pylint, Flake8 and others. The sales pitch is - it does the same thing as the others, except it's 10-100x faster than the others. You could rewrite it in another language, but people aren't replacing ruff unless it's comparable in speed. Do you get it? Speed is a critical feature in some contexts and it's hard to beat Rust here. Not impossible, but hard. Other examples include turbopack, swc, buck2.
- What would you rewrite in Rust?
-
Using TypeScript 4.9 with Next.js 12
Unfortunately, the moment I tried to use anything 4.9-specific, things went sideways rather quickly, as the dev server and build command didn't recognize the feature, due to their use of SWC. Since Next.js 12 hasn't had new releases for a while, the accompanying version of SWC is now significantly out-of-date.
-
How to use Firestore with Redux in a React application
SWC (stands for Speedy Web Compiler ) is a super-fast TypeScript / JavaScript compiler written in Rust. They claim to be “20x faster than Babel on a single thread and 70x faster on four cores”.
What are some alternatives?
vite - Next generation frontend tooling. It's fast!
Rollup - Next-generation ES module bundler
webpack - A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
parcel - The zero configuration build tool for the web. 📦🚀
terser - 🗜 JavaScript parser, mangler and compressor toolkit for ES6+
ts-loader - TypeScript loader for webpack
tsup - The simplest and fastest way to bundle your TypeScript libraries.
ts-node - TypeScript execution and REPL for node.js
Tailwind CSS - A utility-first CSS framework for rapid UI development.
import-maps - How to control the behavior of JavaScript imports
PostCSS - Transforming styles with JS plugins