npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

parcel-plugin-bundle-visualiser

v1.2.0

Published

A plugin for the parcel bundler to visualise bundle contents

Downloads

9,249

Readme

parcel-plugin-bundle-visualiser

A plugin for the Parcel bundler to visualise bundle contents.

NPM Version Linux CI Build Windows CI Build Known Vulnerabilities

Screenshot showing treemap of a bundle

This plugin aims to make it easier to visualise a bundles contents and aid in troubleshooting and optimisation. If you know webpack-bundle-analyzer then this plugin will be very familiar. Bundle contents is presented in a treemap that gives eash asset/folder an area relative to its size on disc.

Install

npm install --save-dev parcel-plugin-bundle-visualiser

Usage

The next time you run your parcel build in production mode (i.e. when NODE_ENV is 'production') a bundle report will be saved to <output directory>/report.html

Interpreting results

When you open the <output directory>/report.html in a browser you'll see a treemap that shows the contents of each bundle that parcel created in the last build. The area an asset takes up on screen is relative to the size of the asset (after any minification but before gzipping). Hover over treemap to see further details;

  • The current bundle/folder or asset file name
  • The path relative to the project root
  • The size of the asset (after any minification but before gzipping)
  • Bundles will also have an estimated gzip size. This is meant as a indicator (actual compression size will depend on your settings when serving the bundle)
  • Time taken to bundle. Not sure this is very useful but leaving it in for now - parcel bundles in parallel so actual total times will be much lower than the simple sums shown here.

Release Notes

  • 1.2.0 Save report to Parcel output directory
  • 1.1.2 Fixed script error in
  • 1.1.1 Report will now only be generated when NODE_ENV=production
  • 1.0.2 Removed '--visualise' cli arg until until bug #6 is resolved
  • 1.0.1 Minor readme tweaks
  • 1.0 Required the passing of arg '--visualise' to parcel build command so that user can dictate when report is generated. Hence incremented major npm version as this is a breaking api change.
  • 0.8 Added onhover toolip showing stats (I dont expect these reports to be viewed on touch devices - if thats incorrect then let me know). Also added gzip size estimate for bundles.
  • 0.2 Initial POC

Contributing

Contribution is welcome to this project. If you have feedback or suggestion then you can add an issue (please do check for duplicates first). If you have a bug fix or minor improvement then see the steps below and have at it. If you intend a more meaty change it's best to raise an issue first to discuss whats planned.

  • Create a fork from this repo in the usual way
  • Make your intended changes and verify they're good
  • Add unit tests for any new functionality
  • Run npm test to ensure code lints and units tests pass (you'll need to run npm install before hand, the first time round)
  • Raise a pull request back to this repo

Credits

  • webpack-bundle-analyzer - This plugin takes heavy inspiration from it and wouldnt exist without it.
  • Parcel - A nice alternative bundler for when you dont need/want lots of configuration.