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

@pithyjs/vite-plugin

v0.2.0-beta.29

Published

Vite plugins for the PithyJS framework. Provides `.pithy` file compilation, `html\`…\`` template transformation, file-based routing, build optimization, design system CSS tree-shaking, SSR dev server, and icon sprite generation.

Readme

@pithyjs/vite-plugin

Vite plugins for the PithyJS framework. Provides .pithy file compilation, html\…`` template transformation, file-based routing, build optimization, design system CSS tree-shaking, SSR dev server, and icon sprite generation.

Installation

npm install @pithyjs/vite-plugin
pnpm add @pithyjs/vite-plugin
yarn add @pithyjs/vite-plugin

Plugins

pithyPlugin

Transforms .pithy single-file components into compiled TypeScript modules with HMR support.

htmlTransformPlugin

Babel-based transform for html\…`tagged template literals. Compiles templates ahead of time (AOT) invite devandvite buildalike, so dev renders what a build ships and no HTML is parsed at runtime.aot: falseopts out and renders every template through the runtime compiler (JIT) until JIT is retired;strictAot: truemakes a template that falls back to JIT an error. The dev serverpithy-ssg` renders static pages through stays on JIT (static export moves to AOT later), so until then an exported page can differ from dev where the two compilers do, such as content for a slot the component does not render (BUG-130).

pithyRouter

File-based routing plugin. Scans a routes directory and generates a typed route manifest as a virtual module.

pithyBuild

Build optimization plugin providing chunk naming strategies, vendor splitting, and route-based code splitting.

designSystemPlugin

CSS tree-shaking plugin that extracts used utility classes and generates only the CSS needed.

It additionally prepends a static color palette to the virtual:pithy-design-system module, so SSR/SSG output — which never runs the runtime ThemeManager — still resolves every var(--color-*). The palette is intentionally not JIT-gated, because UI Kit component SCSS references color tokens outside of any u-* utility class. Cost: a fixed ~36.6 KB raw / ~3.7 KB gzip.

Configure it with the colors option, which must mirror the app's pithy.config.ts designSystem.colors — if the two diverge, hydration rewrites the tokens and the page flashes:

designSystemPlugin({
  colors: { seed: { primary: '#3b82f6' }, mode: 'light' },
});

The palette values are produced by @pithyjs/design-system/palette, which shares its formatter with the runtime writer, so the pre-painted CSS and the values hydration writes are identical by construction.

⚠️ Do not import @pithyjs/design-system/colors/styles in an app that uses this plugin. Both define the same --color-* tokens on overlapping selectors, so whichever comes last in source order wins. If that is the SCSS, your page paints the default theme and your configured seed is ignored. Pick one source of truth.

pithySSR

SSR dev server plugin with auto-mode (pithy.config.ts) and legacy mode (entry-server.ts).

pithyIcons

SVG icon sprite generation plugin with optimization, HMR, and virtual module output.

Two virtual modules are emitted:

  • virtual:pithy-icons — SPRITE_URL, ICON_NAMES, ICON_META for runtime registration via registerIconSprite().
  • virtual:pithy-icons/sprite — SPRITE_CONTENT, the sprite text itself. Used by pithy-ssg to inline the <symbol>s a page actually uses instead of referencing a sprite file the output never ships. Kept as a separate module so the sheet never rides along in a client bundle that only wants the URL. (Studio's exporter solves the same problem, but it runs in a browser and fetches the sprite over HTTP from the registered SPRITE_URL rather than going through this module.)

API Reference

.pithy Plugin

| API | Signature | Stability | Description | | --- | --- | --- | --- | | pithyPlugin | () => Plugin | stable | - |

HTML Transform Plugin

| API | Signature | Stability | Description | | --- | --- | --- | --- | | HtmlTransformPluginOptions | interface HtmlTransformPluginOptions | stable | - | | htmlTransformPlugin | (options?: HtmlTransformPluginOptions) => PluginOption | stable | - |

Build Plugin

| API | Signature | Stability | Description | | --- | --- | --- | --- | | pithyBuild | (options?: PithyBuildOptions) => Plugin | stable | - |

Router Plugin

| API | Signature | Stability | Description | | --- | --- | --- | --- | | pithyRouter | (options?: PithyRouterPluginOptions) => Plugin | experimental | - |

Design System Plugin

| API | Signature | Stability | Description | | --- | --- | --- | --- | | designSystemPlugin | (options?: DesignSystemPluginOptions) => Plugin | experimental | - |

Icons Plugin

| API | Signature | Stability | Description | | --- | --- | --- | --- | | pithyIcons | (options?: PithyIconsOptions) => Plugin | stable | - |

SSR Plugin

| API | Signature | Stability | Description | | --- | --- | --- | --- | | pithySSR | (options?: PithySSRPluginOptions) => Plugin | experimental | - |

Examples

import { pithyPlugin } from '@pithyjs/vite-plugin';

export default defineConfig({
  plugins: [pithyPlugin()],
});
import { htmlTransformPlugin } from '@pithyjs/vite-plugin';

export default defineConfig({
  plugins: [htmlTransformPlugin({ strictAot: true })],
});
// vite.config.ts
import { pithyBuild } from '@pithyjs/vite-plugin';

export default defineConfig({
  plugins: [
    pithyBuild(),
  ],
});
import { pithyRouter } from '@pithyjs/vite-plugin';

export default defineConfig({
  plugins: [pithyRouter({ routesDir: 'src/routes' })],
});
// design-system.config.ts — type import only, so bare Node can load it
import type { DesignSystemConfig } from '@pithyjs/design-system/palette';
export const designSystem: DesignSystemConfig = {
  shadows: { preset: 'elevated' },
};
// vite.config.ts
import { designSystemPlugin } from '@pithyjs/vite-plugin';
import { designSystem } from './design-system.config';
export default defineConfig({
  plugins: [
    designSystemPlugin({
      // Same object pithy.config.ts uses — no mirroring, no drift
      designSystem,
      safelist: ['u-bg-success', /^u-text-/],
      debug: true,
    })
  ]
});
// vite.config.ts
import { pithyIcons } from '@pithyjs/vite-plugin';

export default defineConfig({
  plugins: [
    pithyIcons({ dir: 'src/icons' })
  ]
});
// main.ts — register icons at app startup
import { SPRITE_URL, ICON_NAMES, ICON_META } from "virtual:pithy-icons";
import { registerIconSprite } from "@pithyjs/ui-kit/icons";
registerIconSprite(SPRITE_URL, ICON_NAMES, ICON_META);

Testing

| Feature | Unit | Integration | E2E | Status | | --- | --- | --- | --- | --- | | pithyPlugin | - | - | - | Missing unit, integration |

| Feature | Unit | Integration | E2E | Status | | --- | --- | --- | --- | --- | | HtmlTransformPluginOptions | - | - | - | Missing unit, integration | | htmlTransformPlugin | ✓ | - | - | Missing integration |

| Feature | Unit | Integration | E2E | Status | | --- | --- | --- | --- | --- | | pithyBuild | - | - | - | Missing integration |

| Feature | Unit | Integration | E2E | Status | | --- | --- | --- | --- | --- | | pithyRouter | ✓ | - | - | Missing integration |

| Feature | Unit | Integration | E2E | Status | | --- | --- | --- | --- | --- | | designSystemPlugin | - | ✓ | - | Complete |

| Feature | Unit | Integration | E2E | Status | | --- | --- | --- | --- | --- | | pithyIcons | ✓ | - | - | Complete |

| Feature | Unit | Integration | E2E | Status | | --- | --- | --- | --- | --- | | pithySSR | ✓ | - | - | Complete |

License

MIT