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

@obsidian-plugin-toolkit/vite

v0.2.0

Published

Vite plugins and utilities for Obsidian plugins with React Fast Refresh

Readme

@obsidian-plugin-toolkit/vite

@obsidian-plugin-toolkit/vite is a small helper for building Obsidian plugins with Vite. It wraps Vite’s configuration so you can focus on your plugin code instead of wiring up manifests, dev builds, and bundler defaults.

It is designed to work alongside the rest of @obsidian-plugin-toolkit and follows Obsidian’s plugin packaging conventions.


Installation

npm install --save-dev @obsidian-plugin-toolkit/vite
# or
pnpm add -D @obsidian-plugin-toolkit/vite
# or
yarn add -D @obsidian-plugin-toolkit/vite

You’ll also need Vite and (optionally) the React plugin if you’re building a React-based UI:

npm install --save-dev vite @vitejs/plugin-react

Quick start

Create a vite.config.ts at the root of your Obsidian plugin project:

import path from 'path'
import { defineConfig } from 'vite'
import { createViteObsidianPlugin } from '@obsidian-plugin-toolkit/vite'

const prod = process.env.NODE_ENV === 'production'

export default defineConfig(() => ({
  plugins: [
    createViteObsidianPlugin({
      entryPoints: ['src/main.ts'],
      manifestPath: path.resolve(__dirname, 'manifest.json'),
      outDir: prod
        ? path.resolve(__dirname, 'dist', 'production')
        : path.resolve(__dirname, 'dist', 'development'),
    }),
  ],
  build: {
    emptyOutDir: true,
    sourcemap: !prod,
    minify: prod,
    target: 'es2023',
  },
}))

For React-based UIs, add @vitejs/plugin-react before the Obsidian plugin:

import react from '@vitejs/plugin-react'

export default defineConfig(() => ({
  plugins: [
    react(),
    createViteObsidianPlugin({ /* ... */ }),
  ],
  // ...
}))

Then run:

npx vite dev
npx vite build

API

createViteObsidianPlugin(options) — Returns an array of Vite plugins. Add it to your plugins array.

Options:

  • entryPoints: Array of entry files (e.g. ['src/main.ts'] or ['src/main.ts', 'src/styles.css']). First entry is the main JS; .css entries are bundled into a single stylesheet in outDir. Default: ['src/main.ts'].
  • outDir: Output directory for the built plugin (e.g. dist/development or dist/production). Default: process.cwd().
  • manifestPath: Path to your manifest.json (copied into outDir). Default: 'manifest.json'.

Typical project layout

A minimal Obsidian plugin project using @obsidian-plugin-toolkit/vite usually looks like:

my-obsidian-plugin/
  manifest.json
  package.json
  vite.config.ts
  src/
    main.ts
    styles.css
    ...
  dist/
    development/
    production/    # if you also emit production builds

You can combine this package with other @obsidian-plugin-toolkit/* packages (e.g. @obsidian-plugin-toolkit/react, @obsidian-plugin-toolkit/esbuild) depending on how you prefer to structure your UI and build pipeline.

See examples/demo-plugin-vite for a working example with React.


Goals and non-goals

  • Goals

    • Provide a batteries-included Vite config for Obsidian plugins.
    • Make dev build output, manifests, and React integration straightforward.
    • Keep configuration explicit and TypeScript-friendly.
  • Non-goals

    • Replace Vite’s own config entirely; you can still layer your own Vite plugins and options on top.
    • Handle publishing or packaging; those concerns typically live in your own scripts (e.g. package.mts).