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 🙏

© 2026 – Pkg Stats / Ryan Hefner

build-trace-plugin

v4.8.1

Published

A powerful Rspack plugin for tracing, analyzing, and optimizing builds in React and TypeScript projects. Detects unused modules, oversized files, suspicious dependencies, invalid environment variables, and bundle regressions in a single tool.

Readme

build-trace-plugin

A powerful multi-module diagnostic plugin for Rspack that helps you detect unused modules, oversized files, suspicious dependencies, invalid environment variables, and bundle regressions — all within a single tool.

build-trace-plugin turns your build process into a fully observable and controlled pipeline.


🚀 Features

1. 📊 Build Stats — build statistics logger

Creates a JSON file with build metrics and compares bundle size against the previous build.
Warns you when assets grow unexpectedly.


2. 🧹 Unused Module — unused module detector

Finds modules that are not imported anywhere.


3. 🕵️ DependencyController — suspicious dependency detector

Analyzes module dependencies and flags:

  • dynamic imports
  • commonJS imports
  • mixed-module imports
  • critical dependencies
  • unknown dependency categories

Helps maintain a clean ESM architecture and prevents dependency poisoning.


4. 🗃️ Alias Tracker — tracks your alias usage

Analyzes all resolved module paths and detects usage of @ import aliases. Helps you understand how often each alias is used across your codebase and highlights alias distribution inside the project.

5. 🐘 Large Module — large file detector

Identifies modules that exceed a given file size threshold.


6. 📶 File Size Analyzer — analyzes your build files sizes

Identifies modules that exceed a given file size threshold.


📦 Installation

npm install build-trace-plugin --save-dev
yarn add build-trace-plugin -D

🛠️ Config Example

// rspack.config.ts
import { BuildTracePlugin } from "build-trace-plugin";

module.exports = {
  // ...your config,

  plugins: [
    new BuildTracePlugin({
      // all plugins are disabled by default
      dependencyController: {
        directory: "src",
        fileExtentions: ["ts", "tsx", "js", "jsx"],
      },

      buildStats: {
        outputDir: "stats",
        outputFile: "build-stats.json",
      },

      unusedModule: {
        dir: "src",
        skip: ["__tests__", "types.ts"],
      },

      largeModule: {
        maxFileSize: 1024,
        directory: "services",
      },

      buildFileSize: true,

      aliasTracker: {
        aliasPrefix: '@';
      };
    }),
  ],
};

💾 Output Example


Rspack compiled successfully in 102 ms

🏔️ Large Module Plugin: Build has 3 large modules:
┌─────────┬────────────────────┬──────────────┬────────┬─────────────────────────────┐
│ (index) │ type               │ dependencies │ size   │ name                        │
├─────────┼────────────────────┼──────────────┼────────┼─────────────────────────────┤
│ 0       │ 'javascript/auto'  │ 27           │'1.97KB'│ 'modal.ts'                  │
│ 1       │ 'javascript/auto'  │ 20           │'1.28KB'│ 'header.ts'                 │
│ 2       │ 'javascript/auto'  │ 19           │'1.30KB'│ 'footer.tsx'                │
└─────────┴────────────────────┴──────────────┴────────┴─────────────────────────────┘

🥳 Ununsed Module Plugin: Build has 0 unused modules

🧐 Dependency Controller Plugin: Build has 4 suspected dependencies in modules:
┌─────────┬──────────┬─────────────────────┬────────────────────────────────────────────┐
│ (index) │ critical │ dependency category │ module name                                │
├─────────┼──────────┼─────────────────────┼────────────────────────────────────────────┤
│ 0       │ true     │ 'commonjs'          │ './src/services/modal/modal.model.ts'      │
│ 1       │ true     │ 'commonjs'          │ './src/models/validator/validator.model.ts'│
│ 2       │ false    │ 'unknown'           │ './src/models/button/button.model.ts'      │
│ 3       │ false    │ 'unknown'           │ './src/services/skeleton/index.ts'         │
└─────────┴──────────┴─────────────────────┴────────────────────────────────────────────┘

🗃️ Alias stats by usage:
┌─────────┬────────┬────────────────┐
│ (index) │ amount │ alias          │
├─────────┼────────┼────────────────┤
│ 0       │ 203    │ '@radix-ui'    │
│ 1       │ 1      │ '@effector'    │
│ 2       │ 13     │ '@swc'         │
│ 3       │ 20     │ '@babel'       │
│ 4       │ 5      │ '@floating-ui' │
│ 5       │ 1      │ '@wojtekmaj'   │
│ 6       │ 1      │ '@withease'    │
│ 7       │ 2      │ '@farfetched'  │
└─────────┴────────┴────────────────┘

Build Stats Plugin:
💪 Assets size is normal
✅ Build has finished successfully
📊 Build general stats generated in build_stats/build_stats.json

📶 Build File Size Plugin: Here are your build files sizes
┌─────────┬──────────────────────────────┬─────────┬─────────────┐
│ (index) │ name                         │ type    │ size        │
├─────────┼──────────────────────────────┼─────────┼─────────────┤
│ 0       │ 'vendors.css'                │ 'css'   │ '767.54 KB' │
│ 1       │ 'bundle.ade1f697b57e7583.js' │ 'js'    │ '529.05 KB' │
│ 2       │ 'icon-512.png'               │ 'image' │ '84.10 KB'  │
└─────────┴──────────────────────────────┴─────────┴─────────────┘

License

MIT license