esbuild VS tsup

Compare esbuild vs tsup and see what are their differences.

esbuild

An extremely fast JavaScript and CSS bundler and minifier (by evanw)

tsup

The simplest and fastest way to bundle your TypeScript libraries. (by egoist)
Our great sponsors
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • Scout APM - Truly a developer’s best friend
  • SonarLint - Clean code begins in your IDE with SonarLint
  • Zigi - The context switching struggle is real
esbuild tsup
258 13
34,069 4,005
- -
9.8 8.6
about 16 hours ago 10 days ago
Go TypeScript
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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

Posts with mentions or reviews of esbuild. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-01.
  • AoC Runner for JavaScript and TypeScript
    3 projects | reddit.com/r/adventofcode | 1 Dec 2022
    Runs your solutions in watch mode (with extremely fast compilation for TS using esbuild).
  • E2E Reactivity using Svelte with Phoenix LiveView
    3 projects | dev.to | 17 Nov 2022
    We specify which Svelte component to render from the LiveView component above by setting data-name to the variable name of the import. Note that the variable name of the import must match the data-name attribute of the LiveView component div. Yes this is souper hacky, but due to limitations in esbuild, a dynamic require isn't possible isn't possible 🤦.
  • NodeJs server with JSX routing (feat Fastify)
    5 projects | dev.to | 5 Nov 2022
    esbuild: Transpile JSX and bundle server code
  • The TypeScript compiler is now implemented internally with modules
    16 projects | news.ycombinator.com | 2 Nov 2022
    There are two performance implications of "modularization": initialization-time and run-time.

    You are correct that initializing many modules is usually slower than initializing one module [1]. However, bundling puts all modules into one file, so this PR doesn't actually change anything here. Both before and after this PR, the TypeScript compiler will be published as a single file.

    At run-time, switching to ES modules from another JavaScript module system can be a significant performance improvement because it removes the overhead of communicating between them. Other module systems (e.g. TypeScript namespaces, CommonJS modules) use dynamic property accesses to reference identifiers in other modules while ES modules use static binding to reference the identifiers in other modules directly. Dynamic property access can be a big performance penalty in a large code base. Here's an example of the performance improvement that switching to ES modules alone can bring: https://github.com/microsoft/TypeScript/issues/39247.

    [1] This is almost always true. A random exception to this is that some buggy compilers have O(n^2) behavior with respect to the number of certain kinds of symbols in a scope, so having too many of those symbols in a single scope can get really slow (and thus splitting your code into separate modules may actually improve initialization time). This issue is most severe in old versions of JavaScriptCore: https://github.com/evanw/esbuild/issues/478. When bundling, esbuild deliberately modifies the code to avoid the JavaScript features that cause this behavior.

  • Speed up Node application build time with ESBuild
    6 projects | dev.to | 2 Nov 2022
    I am a big fan SWC and ESBuild, both look like promising tools. But when i find TSX library (not to be confused with React TSX) my choice for the next application was made. What is it? TSX is designed to be a drop-in replacement for node, so you can use it just the way you would use Node, and it is so easy to setup, or make migration from Babel to ESBuild.
  • esbuild Ignore With Comments Plugin
    3 projects | dev.to | 31 Oct 2022
    While esbuild provides a number of tools to exclude certain files or dependencies, I found these insufficient for my needs and thus developed the esbuild-ignore-with-comments-plugin.
  • Setup React App with esbuild
    2 projects | dev.to | 31 Oct 2022
    ESBuild is the solution of that frustrating issue.
  • Are there build systems for the JS/TS world?
    3 projects | reddit.com/r/typescript | 28 Oct 2022
    Oh yeah, in that sense it's even easier because you can just run scripts. Kinda like python. You can install tsx to run typescript files directly. For dependency management I use pnpm, which also comes with a workspace feature for linking dependencies in one monorepo. For compiling I like esbuild because of it's speed, though it doesn't do type checking
  • The creator of Webpack introduces Turbopack, a Rust-based successor that's 700x faster
    6 projects | reddit.com/r/rust | 25 Oct 2022
    If you just want to compile typescript / jsx / react to javascript you'd use a bundler like esbuild or swc.
  • Vercel announces Turbopack, the successor to Webpack
    21 projects | news.ycombinator.com | 25 Oct 2022
    Automatic JSX runtime was added to esbuild in 0.14.51: https://github.com/evanw/esbuild/pull/2349

tsup

Posts with mentions or reviews of tsup. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-09-13.
  • Creating Modern npm Packages
    3 projects | reddit.com/r/javascript | 13 Sep 2022
    I actually recommend using tsup to build instead of tsc. It can bundle if you want, makes it easier to output multiple formats if you want, etc. It's also dead simple and lightning fast (like, MUCH faster than tasc). It's zero config so the build script is as simple as this.
  • The Making of A React Component Librabry
    5 projects | dev.to | 11 Sep 2022
    To bundle your component you will have to use a bundler. There are a lot of options out there but here we will be using tsup because tsup doesn't require a configuration for our use case.
  • Big Changes Ahead for Deno
    13 projects | news.ycombinator.com | 15 Aug 2022
    One option is to do type checking with tsc (or in your unit tests). And build into a single file with tsup.

    https://tsup.egoist.dev/

  • Your first Turborepo
    5 projects | dev.to | 29 Apr 2022
    I'll setting up a new monorepo with a couple of simple apps and a UI library which would be shared by the apps. The goal is not the design and functionalities of these apps, but the tooling and features Turborepo provides. There will be two apps admin and products, both of them will be bundled using Vite. Vite is blazing fast and you should definitely give it a try just for its speed. The UI library, which will contain just a button component, which is written in TypeScript, will be bundled using tsup. tsup uses esbuild underneath, so we can expect blazing fast build times. I'll be using yarn for package management. We will also be using a common eslint configuration which will be shared across all three codebases.
  • TypeScript 4.6 - Compilation is too slow at least for me with 50000 lines of code, moving back to pure JS
    2 projects | reddit.com/r/typescript | 28 Feb 2022
    Highly recommend https://tsup.egoist.sh/
  • Looking for a TSDX alternative - any recommendations 🙃?
    2 projects | reddit.com/r/webdev | 17 Jan 2022
    I was in the same situation and managed to port over to TSUP pretty easily!
  • Improving the Next.js config
    9 projects | dev.to | 22 Dec 2021
    I personally don't like using the CommonJS syntax where possible. To the point that for most projects now when I want to write a simple Node script I quickly add tsup so I can use TypeScript & a number of other handy features. One scenario I particularly hate is when a library offers a object type definition & but you have to use the JSDoc @type {import('...').TypeName} syntax to use it.
  • How to update a NodeJS TypeScript library for ESM-compliance?
    5 projects | reddit.com/r/typescript | 22 Dec 2021
    TSUP is good for bundling https://github.com/egoist/tsup
  • What does it take to support Node.js ESM?
    9 projects | dev.to | 12 Aug 2021
    The best solution for this is to have ESM examples in a monorepo testing firsthand if everything with the logic included doesn't break, using tools that output both CommonJS & ESM like tsup might become very handy, but that might not be straightforward, especially for big projects.

What are some alternatives?

When comparing esbuild and tsup you can also consider the following projects:

swc - Rust-based platform for the Web

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+

Tailwind CSS - A utility-first CSS framework for rapid UI development.

import-maps - How to control the behavior of JavaScript imports

ts-node - TypeScript execution and REPL for node.js

Snowpack - ESM-powered frontend build tool. Instant, lightweight, unbundled development. ✌️ [Moved to: https://github.com/FredKSchott/snowpack]

PostCSS - Transforming styles with JS plugins