{"id":15254647,"url":"https://github.com/guangchen2333/rollup-plugin-userscript-boilerplate","last_synced_at":"2026-01-04T21:40:08.251Z","repository":{"id":200141599,"uuid":"705249608","full_name":"GuangChen2333/rollup-plugin-userscript-boilerplate","owner":"GuangChen2333","description":"一个使 Rollup.js 可以通过 JSON 生成 Userscript 开发时骨架的插件 | A Rollup.js plugin that enables automatic generation of userscript boilerplate from JSON","archived":false,"fork":false,"pushed_at":"2024-02-06T08:10:54.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T11:12:29.223Z","etag":null,"topics":["rollup","rollup-plugin","userscript","userscript-development","vite-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/rollup-plugin-userscript-boilerplate","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/GuangChen2333.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-10-15T13:42:07.000Z","updated_at":"2024-10-25T15:42:36.000Z","dependencies_parsed_at":"2024-11-14T15:00:32.652Z","dependency_job_id":"71039aed-43e4-47a0-b2ec-643dda096b04","html_url":"https://github.com/GuangChen2333/rollup-plugin-userscript-boilerplate","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"970c7d443a43df52723986d4b7a170c921f6f8db"},"previous_names":["guangchen2333/rollup-plugin-userscript-boilerplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuangChen2333%2Frollup-plugin-userscript-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuangChen2333%2Frollup-plugin-userscript-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuangChen2333%2Frollup-plugin-userscript-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuangChen2333%2Frollup-plugin-userscript-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuangChen2333","download_url":"https://codeload.github.com/GuangChen2333/rollup-plugin-userscript-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244825033,"owners_count":20516587,"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","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":["rollup","rollup-plugin","userscript","userscript-development","vite-plugin"],"created_at":"2024-09-29T23:05:24.203Z","updated_at":"2026-01-04T21:40:08.224Z","avatar_url":"https://github.com/GuangChen2333.png","language":"TypeScript","readme":"# rollup-plugin-userscript-boilerplate\n\nA Rollup.js plugin that enables automatic generation of userscript boilerplate from JSON\n\n## Quick Start\n\n### Installation\n\n#### npm\n\n```shell\nnpm install --save-dev rollup-plugin-userscript-boilerplate\n```\n\n#### pnpm\n\n```shell\npnpm install --save-dev rollup-plugin-userscript-boilerplate\n```\n\n#### yarn\n\n```shell\nyarn add --dev rollup-plugin-userscript-boilerplate\n```\n\n### Usage\n\nCreate a `rollup.config.mjs` configuration file and import the plugin:\n\n```js\nimport boilerplate from 'rollup-plugin-userscript-boilerplate';\n\nexport default {\n    input: 'src/index.js',\n    output: {\n        dir: 'output',\n        format: 'iife'\n    },\n    plugins: [\n        boilerplate({\n            // Metadata path\n            metadata: \"src/metadata.json\",\n            // Your source script (like iife format)\n            source: \"src/index.js\",\n            // Output path\n            output: \"output/dev.user.js\"\n        })\n    ]\n};\n```\n\nCreate a `metadata.json` metadata file like this:\n\n```json\n{\n  \"name\": \"my-plugin\",\n  \"version\": \"1.0.0\",\n  \"match\": [\n    \"https://example.com/\",\n    \"https://example.net/\"\n  ]\n}\n```\n\nIt will generate the boilerplate to your path.\n\n```js\n// ==UserScript==\n// @name    my-plugin\n// @version 1.0.0\n// @match   https://example.com/\n// @match   https://example.net/\n// @require file:///example/output/{SOURCE}.js\n// ==/UserScript==\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguangchen2333%2Frollup-plugin-userscript-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguangchen2333%2Frollup-plugin-userscript-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguangchen2333%2Frollup-plugin-userscript-boilerplate/lists"}