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

@hebilicious/cssforge-unplugin

v0.1.2

Published

Bundler plugin that generates CSS Forge design-token output inside the build.

Readme

@hebilicious/cssforge-unplugin

Generate CSS Forge design-token CSS inside the build, through unplugin: Vite, Rollup, Rolldown, webpack, Rspack, Rsbuild, esbuild, Farm, and Bun.

The plugin loads cssforge.config.ts, serves the generated stylesheet from virtual:cssforge.css, and watches the config and every local token module it imports, so a token edit regenerates the stylesheet.

Install

pnpm add -D @hebilicious/cssforge-unplugin

Runtime dependencies are unplugin and @hebilicious/cssforge. Bundlers are not dependencies or peers: your project already has one, and it stays the only one installed. The package exports both ESM and CommonJS, because webpack and Rspack configs are often CommonJS.

Vite

// vite.config.ts
import cssforge from "@hebilicious/cssforge-unplugin/vite";
import { defineConfig } from "vite";

export default defineConfig({
	plugins: [cssforge()],
});
// src/main.ts
import "virtual:cssforge.css";

Add the ambient declaration once so TypeScript accepts the import:

// src/vite-env.d.ts
/// <reference types="@hebilicious/cssforge-unplugin/client" />

Other bundlers

| Bundler | Import | Notes | | --- | --- | --- | | Vite | @hebilicious/cssforge-unplugin/vite | Styles update through HMR when a token changes. | | Rollup | @hebilicious/cssforge-unplugin/rollup | Needs a CSS plugin, or set write. | | Rolldown | @hebilicious/cssforge-unplugin/rolldown | Needs a CSS plugin, or set write. | | webpack | @hebilicious/cssforge-unplugin/webpack | Needs an asset rule for CSS. | | Rspack | @hebilicious/cssforge-unplugin/rspack | Needs an asset rule for CSS. | | Rsbuild | @hebilicious/cssforge-unplugin/rsbuild | CSS is handled out of the box. | | esbuild | @hebilicious/cssforge-unplugin/esbuild | CSS is handled out of the box. | | Farm | @hebilicious/cssforge-unplugin/farm | CSS is handled out of the box. | | Bun | @hebilicious/cssforge-unplugin/bun | CSS is handled out of the box. |

// webpack.config.js
const cssforge = require("@hebilicious/cssforge-unplugin/webpack");

module.exports = {
	plugins: [cssforge()],
};

Options

cssforge({
	// Resolved against the build's working directory. Default: ./cssforge.config.ts
	config: "./cssforge.config.ts",
	// Write the stylesheet to disk as well as serving the virtual module.
	// Default: false
	write: { css: "./.cssforge/output.css" },
});

write: true uses ./.cssforge/output.css, the CLI's default path. Use it when a tool needs a real file, or when a bundler has no CSS handling for virtual modules.

Behavior

  • Lazy generation. The stylesheet is generated the first time virtual:cssforge.css is loaded. With write, it is also generated during buildStart, so the file exists even when nothing imports the module.

  • Watch. The config file and every local module it imports are registered as watch files. A change invalidates the cached stylesheet, so the next build regenerates it. In Vite, the running dev server updates the styles without a page reload.

  • One config per plugin instance. Generation reuses the core generateCSS, so plugin output is byte-identical to the CLI's --mode css output for the same config.

  • No CSS layer. The virtual module serves exactly what generateCSS produces, so the declarations are unlayered. @import "virtual:cssforge.css" layer(cssforge) does not work, because a CSS import resolves to a file. To keep tokens in a cascade layer, set write and import the written file:

    @import "./.cssforge/output.css" layer(cssforge);
  • Errors. A missing config or a generation failure fails the build with the same error the CLI reports, including the config path and the offending token path.

Requirements

Node 24 or newer, matching @hebilicious/cssforge. The config is loaded with Node's native TypeScript support, so no extra loader is needed.