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

@lediv/vite-plugin

v0.1.0

Published

Vite plugin for building Lediv projects

Readme

@lediv/vite-plugin

Vite plugin for building Lediv projects. Serves and builds multi-page HTML applications with component resolution, template evaluation, font injection, and mount script chunking.

Install

npm install @lediv/vite-plugin

Requires vite as a peer dependency.

Usage

import { defineConfig } from 'vite';
import lediv from '@lediv/vite-plugin';

export default defineConfig({
  plugins: [lediv()],
});

The plugin expects a pages/ directory and an optional components/ directory at the Vite root.

Options

lediv({
  preloadFonts: true,
});

| Option | Type | Default | Description | | -------------- | --------- | ------- | ---------------------------------------------------------------------------- | | preloadFonts | boolean | false | Emit <link rel="preload"> tags for fonts detected in each page | | minifyInline | boolean | true | Minify inline <style> and <script> content in emitted pages (build only) |

Dev server

The plugin registers a middleware that:

  • Responds to /fonts/:id/latin-wght-normal.woff2 requests directly from the bundled font assets.
  • Matches request URLs to HTML files under pages/ and serves the built result through transformIndexHtml.
  • Triggers a full page reload on HMR changes inside pages/ or components/.

Build

On build the plugin:

  1. Collects all .html files under pages/ recursively.
  2. Resolves component trees and evaluates template logic for each page.
  3. Emits inline mount scripts as separate JS chunks (one per component instance).
  4. Minifies inline <style> and <script> content unless minifyInline is false. Untyped, type="module", and type="text/javascript" scripts are minified as JavaScript; type="application/ld+json" scripts are compacted through a JSON round-trip and invalid JSON fails the build; scripts with any other type or with a src attribute stay verbatim. Markup outside these blocks is never touched, and the dev server always serves unminified output.
  5. Copies required WOFF2 font files to dist/fonts/:id/.
  6. Emits final HTML files as build assets.

Build utilities entry point

import { buildPage, buildPageFromSource } from '@lediv/vite-plugin/build';

buildPage is the low-level page builder used by the plugin. It accepts a page name and options, reads the source HTML, resolves components, injects font CSS, and returns { html, usedFonts, mountScripts }.

import type { BuildPageOptions, BuildPageResult } from '@lediv/vite-plugin/build';

License

MIT