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

@vigilon/bundler-plugins

v0.2.25

Published

Vigilon build plugins for Vite, Rollup, webpack, and esbuild: debug IDs and source map upload

Readme

@vigilon/bundler-plugins

Build plugins for Vite, Rollup, webpack, and esbuild that link each script your build emits to its source map, so browser errors reported by @vigilon/browser can be shown against your original source.

How it works

At the end of a production build the plugin gives every emitted script one debug ID, a UUID derived from the script and its source map. It writes the ID into the script as a //# debugId= comment and a small runtime registration, and into the source map as debugId. @vigilon/browser reads the registration and sends the IDs of the scripts in an error's stack with the error, so Vigilon can find the right source map no matter what the file is called or where it is served from.

With an upload token, the plugin then uploads each script and its source map to Vigilon, which verifies them before using them.

If a script already has a debug ID, for example from Sentry's bundler plugin, the plugin reuses it and adds nothing to the script, so a script never carries two IDs. Plugin order does not matter.

A hashed file name never serves two different contents. In Rollup and Vite the plugin adds each module's source to the file name hash, because a change that only touches comments can leave the minified code the same while changing its source map, and with it the debug ID.

Install

npm install --save-dev @vigilon/bundler-plugins

Requires Node.js 22.12 or later.

Upload token

In the Vigilon dashboard, open your project's Settings page, then the Source Maps tab, and create an upload token. It starts with vg_sm_ and is shown once. Set it as VIGILON_SOURCE_MAP_TOKEN where your production build runs, for example as a CI secret, and the plugin picks it up. Without a token, the plugin still gives every script a debug ID and uploads nothing.

Keep the token out of your client code: anyone with it can replace your project's source maps. The Source Maps tab also lists the uploaded source maps, and why Vigilon rejected any it could not use.

Set up

Vite

// vite.config.ts
import { defineConfig } from "vite";
import vigilon from "@vigilon/bundler-plugins/vite";

export default defineConfig({
  build: { sourcemap: "hidden" },
  plugins: [vigilon({ uploadToken: process.env.VIGILON_SOURCE_MAP_TOKEN })],
});

Rollup

// rollup.config.mjs
import vigilon from "@vigilon/bundler-plugins/rollup";

export default {
  input: "src/main.js",
  output: { dir: "dist", format: "es", sourcemap: "hidden" },
  plugins: [vigilon()],
};

webpack

// webpack.config.js
const vigilon = require("@vigilon/bundler-plugins/webpack").default;

module.exports = {
  mode: "production",
  devtool: "hidden-source-map",
  plugins: [vigilon()],
};

esbuild

import { build } from "esbuild";
import vigilon from "@vigilon/bundler-plugins/esbuild";

await build({
  entryPoints: ["src/main.js"],
  bundle: true,
  outdir: "dist",
  sourcemap: "external",
  plugins: [vigilon()],
});

The plugin leaves development out: the Vite dev server and webpack mode: "development" builds are untouched. A Vite server-side (SSR) build is skipped too, since it never runs in the browser.

Source maps

The plugin needs source map files. If your build produces none, it turns on hidden source maps (maps with no sourceMappingURL comment) and deletes them once the build is done, so they are never deployed. If your build already produces source maps, they are left in place unless you set deleteSourceMapsAfterUpload. Inline source maps cannot be uploaded.

Options

| Option | Default | Description | |---|---|---| | uploadToken | VIGILON_SOURCE_MAP_TOKEN | A source map upload token for the project, starting with vg_sm_. Without one, debug IDs are injected and nothing is uploaded. An API key does not work here. | | apiUrl | VIGILON_API_URL, then https://api.vigilon.io | The Vigilon API. | | deleteSourceMapsAfterUpload | false | Delete the build's own .map files once they are uploaded. | | onUploadError | "error" | What a failed upload, or a script Vigilon reports as unusable, does to the build: "error" fails it, "warn" logs a warning. | | disabled | false | Turn the plugin off. | | debug | false | Log each script's debug ID. |

Support