Skip to content
Projects

lisonge/vite-plugin-monkey

View on GitHub

lisonge/vite-plugin-monkey has 2,068 GitHub stars and 107 forks. GitHot measured -1 stars in 24 hours. Last checked 2026-11-07 23:14 UTC. Last push 2026-10-29.

How these counts are measured

A vite plugin server and build your.user.js for userscript engine like Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat

What you can do

  • Support Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat, and other userscript engines
  • Inject userscript metadata into the build output
  • Open the development userscript in the default browser when its metadata changes
  • Load external dependencies through userscript @require entries

Measured star growth

in 24h
-1
in 7 days
Update delayed
in 15 days
Update delayed
in 1 month
Update delayed

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

vite-plugin-monkey

npm package node compatibility

Develop and build userscripts for Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat, and other userscript engines with Vite.

Documentation: https://vite-plugin-monkey.pages.dev/

Features

  • Support Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat, and other userscript engines
  • Inject userscript metadata into the build output
  • Open the development userscript in the default browser when its metadata changes
  • Load external dependencies through userscript @require entries
  • Load external modules through userscript @resource entries
  • Import GM APIs through ESM with type hints
  • Collect the GM APIs used by the code and configure @grant automatically
  • Support top-level await and dynamic imports in a single userscript file
  • Open the built userscript automatically when running Vite preview
  • Support TypeScript and Vite features

Quick Start

Create a userscript project with the scaffolding tool:

pnpm create monkey
# npm create monkey
# yarn create monkey

Choose one of the included templates:

JavaScript TypeScript
empty (only js) empty-ts (only ts)
vanilla (js + css) vanilla-ts (ts + css)
vue vue-ts
react react-ts
preact preact-ts
svelte svelte-ts
solid solid-ts
Initializing a Template

vue-ts

Hot Module Replacement

hmr

Build and Preview

build and preview

Installation

Install the plugin in an existing Vite project:

pnpm add -D vite-plugin-monkey
# npm i -D vite-plugin-monkey
# yarn add -D vite-plugin-monkey

Add vite-plugin-monkey as the last item in the Vite plugin list. See the Getting Started guide for the basic configuration.

Explore related projects