{"id":15097494,"url":"https://github.com/serguun42/webpack-userscript-plugin","last_synced_at":"2026-01-07T05:15:31.268Z","repository":{"id":64074849,"uuid":"571787848","full_name":"serguun42/webpack-userscript-plugin","owner":"serguun42","description":"A plugin used build userscripts with Webpack","archived":false,"fork":false,"pushed_at":"2022-12-07T17:27:33.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T17:44:26.528Z","etag":null,"topics":["userscript","webpack"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@serguun42/webpack-userscript-plugin","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serguun42.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}},"created_at":"2022-11-28T22:10:27.000Z","updated_at":"2023-07-25T08:44:01.000Z","dependencies_parsed_at":"2023-01-24T19:18:58.473Z","dependency_job_id":null,"html_url":"https://github.com/serguun42/webpack-userscript-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serguun42%2Fwebpack-userscript-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serguun42%2Fwebpack-userscript-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serguun42%2Fwebpack-userscript-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serguun42%2Fwebpack-userscript-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serguun42","download_url":"https://codeload.github.com/serguun42/webpack-userscript-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245853688,"owners_count":20683237,"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":["userscript","webpack"],"created_at":"2024-09-25T16:22:24.790Z","updated_at":"2026-01-07T05:15:26.215Z","avatar_url":"https://github.com/serguun42.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webpack Userscript Plugin\n\nAppends generated script with Userscript metadata. Continuation of [`serguun42-webpack-userscript`](https://github.com/serguun42/serguun42-webpack-userscript) which itself was a fork of [webpack-userscript package by MomoCow](https://github.com/momocow/webpack-userscript). Supports webpack of versions 4+ and 5+.\n\n## Usage\n\nSuitable for _webpack v4_ and _webpack v5_. From `package.json`:\n\n```json\n\"peerDependencies\": {\n  \"webpack\": \"^4.0.0 || ^5.0.0\"\n}\n```\n\n1. Install – `npm i @serguun42/webpack-userscript-plugin`.\n2. Add to webpack config's plugins section (_usually `webpack.config.js`_):\n\n```javascript\nconst WebpackUserscriptPlugin = require(\"@serguun42/webpack-userscript-plugin\");\n\nmodule.exports = {\n  entry: \"…\",\n  output: {\n    path: \"…\",\n    filename: \"…\",\n  },\n  …\n  plugins: [\n    …,\n    new WebpackUserscriptPlugin(pluginOption),\n    …\n  ]\n}\n```\n\n### Config/params\n\nAdd plugin with constructor:\n\n```javascript\nnew WebpackUserscriptPlugin(pluginOption);\n```\n\nWhere `pluginOption` is object of type [`WebpackUserscriptPluginOptions`](./types/index.d.ts#L37) with following props:\n\n| name      | description/type                                                                                                                          | default      |\n| --------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------ |\n| `headers` | `string` for location of `.json` file with headers or object with metadata fields (of type [`UserscriptMetadata`](./types/index.d.ts#L3)) | **required** |\n| `pretty`  | Prettify headers with even space or not                                                                                                   | `true`       |\n| `metajs`  | Create additional `.meta.js` file (in the same output directory) with headers only                                                        | `false`      |\n\n---\n\n### See also\n\n- [Tampermonkey documentation](https://www.tampermonkey.net/documentation.php)\n- [Metadata block for Violentmonkey](https://violentmonkey.github.io/api/metadata-block/)\n- [Metadata block on greasespot.net](https://wiki.greasespot.net/Metadata_Block)\n- [webpack-userscript package by MomoCow](https://github.com/momocow/webpack-userscript)\n- [generate-file-webpack-plugin by kflGALORE](https://github.com/kflGALORE/generate-file-webpack-plugin/blob/master/src/index.ts#L24)\n- [workbox by GoogleChrome](https://github.com/GoogleChrome/workbox/blob/v6/packages/workbox-webpack-plugin/src/generate-sw.ts#L110)\n\n---\n\n### [BSL-1.0 License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserguun42%2Fwebpack-userscript-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserguun42%2Fwebpack-userscript-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserguun42%2Fwebpack-userscript-plugin/lists"}