Start a project

Tool 120 of 194 · JavaScript

JS Bundle & Source Map Explorer

See exactly which packages and files make up a JavaScript bundle, byte by byte from its source map, and find duplicates and heavy dependencies to cut.

JS Bundle & Source Map Explorer at a glanceIllustration: 1, Bundle + source map; 2, processed in your browser; 3, Bytes by package.JS Bundle & Source Map Explorer</>1Bundle + source map3Bytes by package2In yourbrowser
1 Bundle + source map 2 processed on your device 3 Bytes by package

JS Bundle & Source Map Explorer

Your bundle

Where the bytes go

    By package

    PackageBytesShareFilesGzipped alone

    Largest files

    FilePackageBytesShare

    01

    What it does

    Attributes every byte of a JavaScript bundle to the package and file it came from, using the source map, with a treemap, gzip sizes and duplicates.

    • Version 3 source maps, index maps and inline data: maps
    • Every generated byte attributed to its source, unmapped bytes shown
    • Grouped by npm package, by the last node_modules in the path
    • Packages bundled more than once, with each copy's size

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    A treemap, package and file tables and a CSV, with a Copy and a Download button on every result.

    • JavaScript
    • Source maps
    • Bundle size
    • webpack

    Why it matters

    Bundles grow quietly: a date library pulled in for one function, two copies of a helper package at different versions, a whole utility library imported for a single call. The bundle file itself doesn't say where its bytes came from, but its source map does: every position in the minified code points back to an original file.

    This explorer decodes the map's Base64 VLQ mappings and walks the bundle, giving each byte to the source file its mapping points at, then groups files by npm package. The treemap shows the split at a glance, the tables give exact numbers and each package's gzipped size, and packages installed at more than one path are flagged as duplicates. It works with webpack, Rollup, Vite, esbuild and Parcel output, and everything happens in your browser.

    How it works

    1. InputA JavaScript bundle and its .map
    2. In your browserEvery byte traced back to its source file
    3. OutputA treemap, package sizes, gzip and duplicates

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Working out why a bundle is big and what to cut.

    By the numbers

    Share of the sample bundle by packagereact-dom (11 KB): 47.3%, 2.3 KB gzipped; lodash (6.2 KB): 26.2%, 1.3 KB gzipped; react (2.0 KB): 8.3%, 538 B gzipped; tslib (1.6 KB): 6.9%, 488 B gzipped; date-fns (1.4 KB): 6%, 427 B gzipped; (your code) (724 B): 3%, 433 B gzipped; (webpack runtime) (416 B): 1.7%, 203 B gzipped25%react-dom (11 KB)47.3%, 2.3 KB gzippedlodash (6.2 KB)26.2%, 1.3 KB gzippedreact (2.0 KB)8.3%, 538 B gzippedtslib (1.6 KB)6.9%, 488 B gzippeddate-fns (1.4 KB)6%, 427 B gzipped(your code) (724 B)3%, 433 B gzipped(webpack runtime) (416 B)1.7%, 203 B gzipped
    Measured by this tool from its sample bundle and source map: 24 KB in 1 bundle: 99.4% mapped to 10 source files in 7 groups. Packages from node_modules are 94.7% of it. Gzipped, the whole bundle is 5.1 KB. Packages compressed one by one add up to 5.7 KB, because each loses the shared dictionary. The sample is made up, but laid out the way webpack writes real bundles, with a second copy of tslib nested under another package. Source: ECMA-426 source map format.
    Show the numbers as a table
    PackageBytesShareFilesGzipped alone
    react-dom11 KB47.3%12.3 KB
    lodash6.2 KB26.2%11.3 KB
    react2.0 KB8.3%1538 B
    tslib1.6 KB6.9%2488 B
    date-fns1.4 KB6%1427 B
    (your code)724 B3%3433 B
    (webpack runtime)416 B1.7%1203 B

    How to use it

    1. Build your app with source maps switched on.
    2. Drop the .js bundle and its .js.map (or a bundle with an inline map).
    3. Read the treemap and the package table: biggest first.
    4. Fix duplicates and heavy imports, rebuild and compare.

    FAQ

    Why are my numbers different from the bundle's file size?

    They shouldn't be: every byte is counted, and bytes the map doesn't cover are shown as unmapped. Gzip sizes per package add up to more than the whole bundle gzipped, because each package is compressed without the others' shared patterns.

    What does 'bundled 2 times' mean?

    The same package appears under two node_modules paths, usually because two dependencies want different versions. npm dedupe, or aligning versions, often removes one copy.

    Does it need sourcesContent?

    No. Sizes come from the mappings alone. sourcesContent is only needed to show original code, which the stack trace resolver does.

    Which bundlers work?

    Any that write standard version 3 source maps: webpack, Rollup, Vite, esbuild, Parcel, Terser and others, including index maps with sections.

    Is my code uploaded?

    No. Files are read and measured in your browser. The sample is a made-up bundle served from this site.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk