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

@rabbita/vite

v0.2.0

Published

Vite plugin for Rabbita applications built with MoonBit.

Downloads

633

Readme

rabbita-vite-plugin

Vite plugin for Rabbita applications built with MoonBit.

What it handles

  • Runs moon build --target js --target-dir <tmp> for plugin-owned output
  • Uses debug output during vite dev and release output during vite build
  • Finds generated JS with find under <tmp>/js/<debug|release>/build
  • Relies on Vite's default dev-server watcher for live reload
  • Does not parse MoonBit project config files to infer source directories

Install

npm i -D @rabbita/vite

Usage

import { defineConfig } from 'vite'
import rabbita from '@rabbita/vite'

export default defineConfig({
  plugins: [rabbita({ mainPkgDir: 'src/main' })],
})

mainPkgDir is a filesystem path relative to the Vite config file. The plugin runs moon build . inside that directory.

mainPkgDir must stay inside the directory that contains vite.config.*. MoonBit files outside that directory are intentionally unsupported.

If mainPkgDir is omitted, the plugin runs moon build in the Vite root and the build must produce exactly one JS file. In that mode, the Vite root is also treated as the MoonBit build directory and must stay inside the Vite config directory.

For live reload, the plugin does not add custom dev-server watch roots. It rebuilds only when Vite reports a MoonBit file change through its watcher.

If your HTML lives in a subdirectory, keep Vite root at the project directory and point Rollup at the HTML entry:

export default defineConfig({
  build: {
    rollupOptions: {
      input: 'app/index.html',
    },
  },
  plugins: [rabbita({ mainPkgDir: '.' })],
})

If the host filesystem does not emit native change events reliably, configure Vite's own watcher, for example server.watch.usePolling. The plugin does not force polling.

Deprecated compatibility options

main and moonModDir are kept for compatibility, but new projects should use mainPkgDir.

import { defineConfig } from 'vite'
import rabbita from '@rabbita/vite'

export default defineConfig({
  plugins: [rabbita({ main: 'moonbitlang/mooncakes/main' })],
})

For main, the plugin first searches generated JS output with the full selector. If that fails and the selector has a user/name/... prefix, it also tries the path after the first two segments, so moonbitlang/mooncakes/main can match main/main.js.