esbuild VS terser

Compare esbuild vs terser and see what are their differences.

terser

đź—ś JavaScript parser, mangler and compressor toolkit for ES6+ (by terser)
Our great sponsors
  • SonarLint - Clean code begins in your IDE with SonarLint
  • ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
  • InfluxDB - Access the most powerful time series database as a service
esbuild terser
300 22
35,360 7,871
- 0.6%
9.7 7.9
12 days ago 6 days ago
Go JavaScript
MIT License GNU General Public License v3.0 or later
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 2023-05-09.

terser

Posts with mentions or reviews of terser. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-03-06.
  • Minify private methods in a TypeScript class
    2 projects | dev.to | 6 Mar 2023
    Terser is JavaScript compressor that can minified specific method names.
  • Setting up a custom toolchain
    11 projects | reddit.com/r/reactjs | 26 Dec 2022
    A minifier makes your code more compact so that it loads faster. Popular minifiers: Terser, swc.
  • Overview of the next-gen frontend dev tools
    4 projects | dev.to | 8 Nov 2022
    There are many minifiers such as terser and uglify. But, because minifying also require to parse the JS, it is actually possible to use esbuild and SWC to minify the code. Here's a benchmark of the main minifiers.
  • Rollup Library Starter
    9 projects | dev.to | 5 Oct 2022
    This next one will help us reduce final bundle size by minifying the generated code. It's called rollup-plugin-terser and uses terser under the hood to minify the code.
  • I reduced an npm package size by 50% with minification
    2 projects | dev.to | 27 Sep 2022
    fifty-three kilo-byte was a little bit large, and since the bundler i'm using for this package is rollup.js, all ineeded to do was install the terser — a JavaScript compressor toolkit for ES6 mdash; plugin for rollup.
  • How to build tree-shakeable JavaScript libraries
    7 projects | dev.to | 14 Sep 2022
    You can see that the div function was copied “as is” and is not used in any way. When you run Webpack in production mode, it will remove this function. (Internally, Webpack relies on Terser for minification; Rollup performs tree-shaking and dead code elimination on its own.)
  • 📦 Bundle Node.js into single executable binary
    6 projects | dev.to | 20 Aug 2022
    However, using the ESM packaging format has one advantage than CJS: tree-shaking. Tree-shaking is the concept of removing unused code from a dependency. Tools: esbuild, parcel, webpack, rollup, terser.
  • Minify JavaScript Using Terser
    2 projects | dev.to | 8 Aug 2022
    Install terser using yarn or npm.
  • Writing your own module bundler
    2 projects | dev.to | 16 Apr 2022
    Thus we have written our own module bundler by following the rollup way. We can also support a few extra options like code minification and mangling by using terser, we can also support iife format by wrapping the bundle with an iife expression. Since this is a basic example on how a bundler works, I have skimmed through a few stuffs, but in practice module bundlers are quite complex and interesting to learn about.
  • Tilepieces
    3 projects | reddit.com/r/u_tilepieces | 8 Apr 2022
    The project is built with itself, and uses some of the popular frontend libraries like codemirror and terser.To build a tilepieces application, read the instructions.

What are some alternatives?

When comparing esbuild and terser 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. 📦🚀

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

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

ts-jest - A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript.