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

vite-plugin-dep-sourcemaps

v0.1.0

Published

Chain a bundle's sourcemaps through its dependencies' sourcemaps so stack traces resolve to the original source instead of the bundled dist — works under Rolldown / Vite 8 where external dependency sourcemaps aren't chained yet.

Readme

vite-plugin-dep-sourcemaps

Chain a bundle's sourcemaps through its dependencies' own sourcemaps, so stack traces (e.g. in Sentry) resolve to a dependency's original source instead of its bundled dist.

Useful under Rolldown / Vite 8, which doesn't yet chain pre-existing external dependency sourcemaps on its own (see vitejs/vite#11743 and vitejs/vite#21965). The classic rollup-plugin-sourcemaps works via the load hook, which Rolldown ignores — this plugin instead post-processes the finished output maps, so it works regardless.

The problem

When you bundle a dependency that ships its own dist/*.js + dist/*.js.map (built from .ts/.tsx), the ideal build sourcemap should point at that dependency's original source. Under Rollup this "just works"; under Rolldown it currently doesn't — the map points at the bundled dist/index.js, so an error in a dependency shows up at the wrong place.

Install

npm i -D vite-plugin-dep-sourcemaps

Usage

// vite.config.ts
import { defineConfig } from 'vite';
import depSourcemaps from 'vite-plugin-dep-sourcemaps';

export default defineConfig({
  build: {
    sourcemap: true, // required
  },
  plugins: [depSourcemaps()],
});

By default it chains any source resolving under node_modules. Order it before plugins that consume the final maps (e.g. @sentry/vite-plugin) so they see the remapped output.

Options

depSourcemaps({
  // Only chain deps whose resolved path matches (string = substring, RegExp = test).
  // Default: 'node_modules'
  include: [/@myscope\//, 'some-lib'],

  // Skip deps whose resolved path matches.
  exclude: [/node_modules\/big-untyped-lib\//],
});

| Option | Type | Default | Description | | --------- | ----------------------------- | ---------------- | ------------------------------------------------------ | | include | string \| RegExp \| Array | 'node_modules' | Only chain dependency sources matching these. | | exclude | string \| RegExp \| Array | [] | Skip dependency sources matching these. |

How it works

Runs in the writeBundle hook (after the bundle is written). For every emitted *.js.map, it re-composes the map through the deps' own sidecar *.js.map files using @ampproject/remapping, following each //# sourceMappingURL one level down to the original source. It breaks cycles, resolves relative paths against the map's location, and leaves a map untouched if anything goes wrong.

Requirements

  • build.sourcemap enabled.
  • Dependencies must ship sidecar <file>.js.map files (ideally with sourcesContent). Inline sourcemaps aren't chained.

License

MIT © Javad Tavakoli