ESbuild plugin suite for building userscripts targeting Tampermonkey, Greasymonkey, Violentmonkey, and other userscript engines. Current stable version is 0.2.6. The package provides three distinct plugins: `userscript-inject-code` for injecting code fragments, `userscript-metadata` for generating metadata headers (e.g., @name, @match, @grant), and `userscript-proxy` to create development proxy scripts that bypass browser cache during development. Unlike general bundler plugins, this package is purpose-built for userscript workflows, supporting both CommonJS and ESM via esbuild. Key differentiators include combined or individual plugin usage, TypeScript-first design, and minimal configuration overhead.
npm install esbuild-plugin-userscriptNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows a complete esbuild build configuration using the userscript plugin to add metadata and proxy support for development.
Start a local dev server (e.g., `npx serve dist`) or use a separate tool like `browser-sync`.
Replace `userscriptMetadata()` with `userscript.metadata()` via `import { userscript } from 'esbuild-plugin-userscript'`.Use `match: ['https://*/*']` instead of `'@match': ...`.
Use `const { userscript } = require('esbuild-plugin-userscript')` or switch to ESM `import`.Run `npm install esbuild-plugin-userscript --save-dev`
Use `import { userscript } from 'esbuild-plugin-userscript'` instead of `import userscript from ...`Use keys without '@': e.g., `name: 'My Script'` instead of `'@name': 'My Script'`.
Start your own dev server (e.g., `http-server dist`) or use a watcher that serves files.
No dependency data recorded yet.