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

@rolster/rollup

v2.2.0

Published

Package containing the basic definitions for handling data types.

Downloads

255

Readme

Rolster Rollup

Shared Rollup configuration builder for Rolster TypeScript packages. It standardizes the build pipeline across every @rolster/* project, producing CommonJS, ESM and type declarations from a single, small config file.

Installation

npm i @rolster/rollup -D

Rollup and the @rollup/plugin-* plugins it needs (commonjs, node-resolve, typescript) are already bundled as dependencies, so you don't have to install them yourself. The package also exposes the rolster-rollup command, which runs the bundled Rollup CLI, so consumer projects never need to depend on rollup directly. In the consumer project you only need typescript (to run tsc) and, for the recommended clean script, rimraf.

How it works

The package exports a single function, rolster(options), that returns an array of Rollup configurations. A Rolster build runs in two steps:

  1. tsc compiles src/**/*.ts into dist/esm/ (JavaScript + .d.ts).
  2. rolster-rollup takes each dist/esm/<entry>.js and bundles it into dist/cjs/<entry>.cjs and — when requiredEsm is enabled — dist/es/<entry>.mjs.

Using it in a project

Four pieces wire a package into this pipeline.

1. rollup.config.mjs

import rolster from '@rolster/rollup';

export default rolster({
  entryFiles: ['index'],
  requiredEsm: true,
  packages: ['@rolster/i18n'] // external deps: not bundled, kept as `external`
});

2. Build scripts in package.json

{
  "scripts": {
    "clean": "rimraf ./dist",
    "build": "npm run clean && tsc -p tsconfig.app.json && rolster-rollup",
    "prepublishOnly": "npm run build"
  }
}

rolster-rollup runs the Rollup CLI bundled with this package using rollup.config.mjs from the current directory. Any extra flag is forwarded to Rollup (for example rolster-rollup --watch), and passing your own -c replaces the default config file.

3. tsconfig.app.json

The build compiles with a dedicated tsconfig that emits only the library source (excluding specs):

{
  "extends": "./tsconfig.json",
  "files": ["node_modules/@rolster/types/index.d.ts"],
  "include": ["src/**/*.ts"],
  "exclude": ["src/**/*.spec.ts"]
}

4. Entry points in package.json

Point the published fields at the generated output:

{
  "types": "./dist/esm/index.d.ts",
  "main": "./dist/cjs/index.cjs",
  "module": "./dist/es/index.mjs",
  "exports": {
    ".": {
      "types": "./dist/esm/index.d.ts",
      "node": {
        "require": "./dist/cjs/index.cjs",
        "import": "./dist/es/index.mjs"
      },
      "default": "./dist/es/index.mjs"
    }
  }
}

API — rolster(options)

| Option | Type | Default | Description | | ---------------------------- | ----------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------- | | entryFiles | string[] | required | Entry names (without extension). Each is read from <path>/esm/<entry>.js and produces one Rollup config. | | requiredEsm | boolean | false | When true, also emits an ESM bundle at <path>/es/<entry>.mjs (besides the CJS one). | | packages | string[] | [] | Packages marked as external (not bundled) — e.g. other @rolster/* dependencies. | | path | string | 'dist' | Base folder for both input and output. | | plugins | Plugin[] | [] | Extra Rollup plugins appended after the Rolster defaults. | | pluginsOptions.nodeResolve | RollupNodeResolveOptions | — | Options forwarded to @rollup/plugin-node-resolve. | | pluginsOptions.typescript | Partial<RolsterTypescriptOptions> | see below | Overrides for @rollup/plugin-typescript. |

Returns: RollupOptions[] — one configuration per entry in entryFiles.

TypeScript plugin defaults

Each config applies these defaults (override via pluginsOptions.typescript):

{
  tsconfig: './tsconfig.app.json',
  declaration: true,
  declarationDir: 'dist',
  include: ['node_modules/@rolster/types/index.d.ts']
}

Generated output (per entry)

  • CJS: <path>/cjs/<entry>.cjs
  • ESM (only if requiredEsm: true): <path>/es/<entry>.mjs

Both are emitted with source maps and inlineDynamicImports.

Example: a package with an external dependency

import rolster from '@rolster/rollup';

// @rolster/dates depends on @rolster/i18n, which must stay external
export default rolster({
  entryFiles: ['index'],
  requiredEsm: true,
  packages: ['@rolster/i18n']
});

Contributing

  • Daniel Andrés Castillo Pedroza :rocket: