← All benchmarksJavaScript

JavaScript bundle size: moment + lodash 138 KB vs dayjs + lodash-es 11 KB

How much smaller is a bundle with dayjs and a single lodash import than with moment and full lodash?

A tiny file that formats a date and chunks an array bundled to 138 KB (47 KB gzipped) with moment and full lodash, and 11 KB (4.9 KB gzipped) with dayjs and lodash-es/chunk, using esbuild --bundle --minify.

Results

moment + lodash138 KB (47 KB gzip)
dayjs + lodash-es/chunk11 KB (4.9 KB gzip)

How it was measured

esbuild --bundle --minify.

import chunk from 'lodash-es/chunk.js';

Why

Importing one function allows tree-shaking; moment bundles locale data.

When this does not apply

Real apps differ; check with a bundle analyzer.

Environment

MacBook Air (Apple silicon, 8 cores), macOS. Measured 2026-10-12.

Source: shorts/demo-ticket/bundle in my content-engine repository. Treat any single run as a direction; re-run it on your hardware.

By Josué Barros, senior software engineer (full-stack, data and AI).