{"id":14988956,"url":"https://github.com/greasify/vite-userscript-plugin","last_synced_at":"2025-09-13T00:41:35.142Z","repository":{"id":56814509,"uuid":"524817519","full_name":"greasify/vite-userscript-plugin","owner":"greasify","description":"⚡️ A Vite plugin to build userscripts for Tampermonkey, Greasemonkey and Violentmonkey.","archived":false,"fork":false,"pushed_at":"2024-09-17T13:15:31.000Z","size":349,"stargazers_count":56,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-02T01:45:19.114Z","etag":null,"topics":["greasemonkey","hacktoberfest","plugin","tampermonkey","typescript","userscript","violentmonkey","vite","vite-plugin"],"latest_commit_sha":null,"homepage":"https://npmjs.com/vite-userscript-plugin","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greasify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-15T01:06:31.000Z","updated_at":"2025-08-03T14:08:35.000Z","dependencies_parsed_at":"2023-07-26T21:09:39.567Z","dependency_job_id":"991cfda7-2fe7-4dff-aa71-779bb17eb850","html_url":"https://github.com/greasify/vite-userscript-plugin","commit_stats":{"total_commits":177,"total_committers":1,"mean_commits":177.0,"dds":0.0,"last_synced_commit":"d1ac3d5a3ba8071ad8114baf4f5329d457e063b9"},"previous_names":["crashmax-dev/vite-userscript-plugin"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/greasify/vite-userscript-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greasify%2Fvite-userscript-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greasify%2Fvite-userscript-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greasify%2Fvite-userscript-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greasify%2Fvite-userscript-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greasify","download_url":"https://codeload.github.com/greasify/vite-userscript-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greasify%2Fvite-userscript-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274902557,"owners_count":25371078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["greasemonkey","hacktoberfest","plugin","tampermonkey","typescript","userscript","violentmonkey","vite","vite-plugin"],"created_at":"2024-09-24T14:17:29.472Z","updated_at":"2025-09-13T00:41:35.094Z","avatar_url":"https://github.com/greasify.png","language":"TypeScript","readme":"# vite-userscript-plugin\n\n[![npm](https://img.shields.io/npm/v/vite-userscript-plugin)](https://npmjs.com/vite-userscript-plugin)\n[![license](https://img.shields.io/github/license/crashmax-dev/vite-userscript-plugin)](./LICENCE)\n[![template](https://img.shields.io/github/package-json/v/crashmax-dev/vite-userscript-template?label=vite-userscript-template)](https://github.com/crashmax-dev/vite-userscript-template)\n\n\u003e ⚡️ A plugin for developing and building a Tampermonkey userscript based on [Vite](https://vitejs.dev).\n\n## Table of contents\n\n- [Features](#features)\n- [Install](#install)\n- [Setup config](#setup-config)\n- [Using style modules](#using-style-modules)\n- [Plugin configuration](#plugin-configuration)\n\n## Features\n\n- 🔥 Reloading page after changing any files.\n- 🔧 Configure Tampermonkey's Userscript header.\n- 💨 Import all [`grant`](https://www.tampermonkey.net/documentation.php#_grant)'s to the header by default in development mode.\n- 📝 Automatic addition of used [`grant`](https://www.tampermonkey.net/documentation.php#_grant)'s in the code when building for production.\n- 📦 Built-in Tampermonkey's TypeScript type definition.\n\n## Install\n\n```\nnpm install vite-userscript-plugin -D\n```\n\n```\nyarn add vite-userscript-plugin -D\n```\n\n```\npnpm add vite-userscript-plugin -D\n```\n\n### Setup config\n\n```js\nimport { defineConfig } from 'vite'\nimport Userscript from 'vite-userscript-plugin'\nimport { name, version } from './package.json'\n\nexport default defineConfig((config) =\u003e {\n  return {\n    plugins: [\n      Userscript({\n        entry: 'src/index.ts',\n        header: {\n          name,\n          version,\n          match: [\n            'https://example.com/',\n            'https://example.org/',\n            'https://example.edu/'\n          ]\n        },\n        server: {\n          port: 3000\n        }\n      })\n    ]\n  }\n})\n```\n\n### Setup NPM scripts\n\n```json\n// package.json\n{\n  \"scripts\": {\n    \"dev\": \"vite build --watch --mode development\",\n    \"build\": \"vite build\"\n  }\n}\n```\n\n### Setup TypeScript [types](https://www.typescriptlang.org/tsconfig#types)\n\n```json\n// tsconfig.json\n{\n  \"compilerOptions\": {\n    \"types\": [\n      \"vite-userscript-plugin/types/tampermonkey\"\n    ]\n  }\n}\n```\n\n### Using style modules\n\n```js\nimport style from './style.css?raw'\n\n// inject style element\nconst styleElement = GM_addStyle(style)\n\n// remove style element\nstyleElement.remove()\n```\n\n## Plugin configuration\n\n```ts\ninterface ServerConfig {\n  /**\n   * {@link https://github.com/sindresorhus/get-port}\n   */\n  port?: number;\n\n  /**\n   * @default false\n   */\n  open?: boolean;\n}\n\ninterface UserscriptPluginConfig {\n  /**\n   * Path of userscript entry.\n   */\n  entry: string;\n\n  /**\n   * Userscript header config.\n   *\n   * @see https://www.tampermonkey.net/documentation.php\n   */\n  header: HeaderConfig;\n\n  /**\n   * Server config.\n   */\n  server?: ServerConfig;\n}\n```\n\n## Examples\n\nSee the [examples](https://github.com/crashmax-dev/vite-userscript-plugin/tree/master/examples) folder.\n\n## License\n\n[MIT](./LICENCE) © [crashmax](https://github.com/crashmax-dev)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreasify%2Fvite-userscript-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreasify%2Fvite-userscript-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreasify%2Fvite-userscript-plugin/lists"}