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

@pandino/rollup-bundle-plugin

v0.9.30

Published

Rollup/Vite plugin for Pandino to generate a BundleModule from decorators

Readme

@pandino/rollup-bundle-plugin

Rollup/Vite plugin for Pandino that discovers decorators (e.g. @Component) across your source files and generates a BundleModule the Pandino runtime can consume.

The generated module can be imported via a virtual id (pandino:bundle) and is also emitted as a physical chunk (default: pandino/bundle.js).

Install

pnpm add -D @pandino/rollup-bundle-plugin

Peer dependencies: rollup (>=3) and/or vite (>=4).

What it generates

A module exporting default object matching Pandino's BundleModule shape:

export default {
  headers: {
    bundleSymbolicName: string,
    bundleVersion: string,
  },
  activator?: BundleActivator, // default export of provided activator file
  components?: (new (...args: any[]) => any)[], // collected classes annotated with @Component
}
  • headers are derived from the nearest package.json (name -> bundleSymbolicName, version -> bundleVersion).
  • components are classes found in files that contain the configured decorator (default: @Component).
  • activator is set to the default export of the configured activator module, if provided.

Usage with Vite

// vite.config.ts
import { defineConfig } from 'vite';
import pandinoBundle from '@pandino/rollup-plugin-bundle';

export default defineConfig({
  // ...
  plugins: [
      pandinoBundle({
          virtualId: 'pandino:bundle:alpha',
          include: ['src/bundles/alpha/**/*.{ts,tsx}'],
          activator: 'src/bundles/alpha/activator.ts',
          headers: {
              bundleSymbolicName: `${packageJson.name}.alpha`,
              bundleVersion: packageJson.version,
              bundleDescription: 'Alpha example bundle',
          },
      }),
  ],
});

Every pandinoBundle() call creates a separate bundle. You can call it multiple times with different options if needed.

Then in your app you can import:

import { type FC, StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { PandinoProvider } from '@pandino/react-hooks';

const Root: FC = () => {
    return (
        <PandinoProvider bundles={[import('pandino:bundle:alpha'), /* ... */]}>
            {/* ... */}
        </PandinoProvider>
    );
};

const rootElement = document.getElementById('root')!;

createRoot(rootElement).render(
  <StrictMode>
    <Root />
  </StrictMode>,
);

The virtualId option is only necessary if you want to import the bundle module directly. If you only want the emitted chunk, you can omit it.

Options

  • include: string | string[]
    • Glob(s) to include. Default: ['**/*.{js,jsx,ts,tsx}']
  • exclude: string | string[]
    • Glob(s) to exclude. Default: ['**/node_modules/**', '**/dist/**', '**/build/**']
  • rootDir: string
    • Root directory for scanning and for resolving package.json. Default: process.cwd()
  • componentsDecorator: string
    • Decorator name to detect as components. Default: Component
  • activator: string
    • Path to a module whose default export implements Pandino's BundleActivator.
  • virtualId: string
    • Virtual module id to expose. Default: pandino:bundle
  • outputFile: string
    • Emitted chunk path (relative to Rollup output dir). Default: pandino/bundle.js

Notes and limitations

  • Detection uses AST parsing via the TypeScript compiler API to find exported classes annotated with your configured decorator name (default: Component). Only real decorators are supported; commented markers are not recognized. It supports both export class Foo and export default class Foo.
  • The plugin scans the filesystem at build start using the include/exclude globs and also observes files passing through Rollup's transform hook.

Testing

This repository contains Vitest tests under src/__tests__ demonstrating typical usage. Run tests from the monorepo root:

pnpm test

License

EPL-2.0