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

@vitus-labs/tools-rolldown

v2.1.0

Published

[Rolldown](https://rolldown.rs)-powered build tool for TypeScript libraries.

Downloads

4,261

Readme

@vitus-labs/tools-rolldown

Rolldown-powered build tool for TypeScript libraries.

A fast, Rust-based alternative to @vitus-labs/tools-rollup.

Installation

bun add -d @vitus-labs/tools-rolldown

Usage

Add to your package.json:

{
  "scripts": {
    "build": "vl_rolldown_build",
    "dev": "vl_rolldown_build-watch"
  }
}

How it works

The build tool reads your package.json to determine what output bundles to produce:

| package.json field | Format | Platform | |---|---|---| | exports.import | ESM | universal | | exports.require | CJS | universal | | main | CJS or ESM | universal | | module | ESM | universal | | browser | same as source | browser | | react-native | ESM | native | | umd:main | UMD | — | | unpkg | UMD (minified) | — |

TypeScript declarations are generated automatically when exports.types (or types/typings) is set.

Platform globals

These constants are injected at build time based on the output platform:

| Constant | Description | |---|---| | __VERSION__ | Package version from package.json | | __BROWSER__ | true for browser builds | | __NODE__ | true for node builds | | __WEB__ | true for node + browser + universal | | __NATIVE__ | true for React Native builds | | __CLIENT__ | true for browser + native |

Add type declarations to your project:

{
  "compilerOptions": {
    "types": ["@vitus-labs/tools-rolldown/global"]
  }
}

Configuration

Configure via vl-tools.config.mjs (key: build):

export default {
  build: {
    sourceDir: 'src',
    outputDir: 'lib',
    typescript: true,
    esModulesOnly: false,
    replaceGlobals: true,
    external: ['react/jsx-runtime'],
    globals: {
      react: 'React',
      'react-dom': 'ReactDOM',
    },
  },
}

Advanced build options

For non-library builds (Chrome extensions, CLI tools, serverless functions, Electron), you can override the default package.json-driven pipeline:

export default {
  build: {
    // Explicit entries — skips package.json field detection
    entries: [
      { input: 'src/background.ts', file: 'dist/background.js', format: 'iife', env: 'production' },
      { input: 'src/content.ts', file: 'dist/content.js', format: 'iife' },
      { input: 'src/popup.ts', file: 'dist/popup.js', format: 'es' },
    ],

    // Bundle all dependencies (no externals)
    bundleAll: true,

    // Copy static assets after build
    copyFiles: [
      { from: 'src/manifest.json', to: 'dist/manifest.json' },
      { from: 'src/popup.html', to: 'dist/popup.html' },
    ],

    // Inject text at top/bottom of output
    banner: '#!/usr/bin/env node',
    footer: '// Generated by @vitus-labs/tools-rolldown',

    // Resolve aliases
    alias: {
      '@': './src',
      'node:crypto': './src/polyfills/crypto.ts',
    },

    // Custom rolldown plugins (appended to built-in ones)
    plugins: [],

    // Disable declarations for non-library builds
    typescript: false,
  },
}

| Option | Type | Default | Description | |---|---|---|---| | entries | Array<{ input, file, format?, env?, platform? }> | undefined | Explicit entry points (bypasses package.json detection) | | bundleAll | boolean | false | Bundle all dependencies instead of externalizing | | copyFiles | Array<{ from, to }> | undefined | Copy static files/directories after build | | banner | string | undefined | Text injected at the top of each output file | | footer | string | undefined | Text injected at the bottom of each output file | | alias | Record<string, string> | undefined | Resolve aliases for import remapping | | plugins | RolldownPlugin[] | [] | Custom plugins appended to built-in ones |

License

MIT