A Vite plugin for developing and building userscripts with modern tooling and full TypeScript support.
vite-plugin-monkey is a Vite plugin designed for developing and building userscripts. It allows developers to create scripts for browser extension engines like Tampermonkey, Violentmonkey, and Greasemonkey using modern JavaScript frameworks, TypeScript, and Vite's development features. The plugin automates metadata injection, handles external dependencies, and provides a streamlined workflow from development to production builds.
Frontend developers and userscript creators who want to use modern tooling (Vite, TypeScript, React, Vue, etc.) to build and maintain complex browser userscripts.
Developers choose vite-plugin-monkey because it brings the speed and developer experience of Vite to userscript development, with features like Hot Module Replacement, automatic metadata generation, and seamless integration with popular frameworks—saving time and reducing configuration overhead.
A vite plugin server and build your.user.js for userscript engine like Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables instant feedback during development by supporting Vite's HMR, as shown in the README's gif where code changes reflect immediately without page reloads.
Intelligently injects userscript metadata like @grant and @require based on actual GM API usage in code, reducing manual configuration and errors.
Provides ESM imports for GM APIs with full TypeScript support, including auto-import and type hints, enhancing development experience and code reliability.
Supports multiple frameworks like Vue, React, Svelte, and vanilla JS/TS through pre-built templates, allowing developers to choose their preferred tools.
In serve mode, scripts can be blocked by browser CSP policies, requiring additional extensions like Disable-CSP to work around it, adding complexity to the setup.
Configuring external globals and resources for CDN injection involves detailed mapping and can be error-prone, especially with IIFE/UMD compatibility issues as noted in the 'Mixed IIFE and UMD' section.
Must be the last plugin in the Vite configuration list, which can lead to conflicts or build errors if not carefully managed, as emphasized in the 'Work with other plugins' note.