{"id":16492772,"url":"https://github.com/hubcarl/service-worker-precache-webpack-plugin","last_synced_at":"2026-05-13T00:35:50.719Z","repository":{"id":65412258,"uuid":"119973570","full_name":"hubcarl/service-worker-precache-webpack-plugin","owner":"hubcarl","description":"create service worker javascript file by webpack manifest","archived":false,"fork":false,"pushed_at":"2018-05-31T02:42:49.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T02:52:09.276Z","etag":null,"topics":["progressive-web-app","pwa","service-worker","service-worker-manifest","service-worker-precache","webpack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hubcarl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-02T11:26:58.000Z","updated_at":"2021-12-10T06:08:21.000Z","dependencies_parsed_at":"2023-01-22T07:35:12.543Z","dependency_job_id":null,"html_url":"https://github.com/hubcarl/service-worker-precache-webpack-plugin","commit_stats":null,"previous_names":["hubcarl/service-worker-webpack-plugin"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/hubcarl/service-worker-precache-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubcarl%2Fservice-worker-precache-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubcarl%2Fservice-worker-precache-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubcarl%2Fservice-worker-precache-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubcarl%2Fservice-worker-precache-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hubcarl","download_url":"https://codeload.github.com/hubcarl/service-worker-precache-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubcarl%2Fservice-worker-precache-webpack-plugin/sbom","scorecard":{"id":471882,"data":{"date":"2025-08-11","repo":{"name":"github.com/hubcarl/service-worker-precache-webpack-plugin","commit":"e14db82309848333e55c50ad8903c72b8a96ab38"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T14:07:10.865Z","repository_id":65412258,"created_at":"2025-08-19T14:07:10.866Z","updated_at":"2025-08-19T14:07:10.866Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32963172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"ssl_error","status_checked_at":"2026-05-12T23:30:18.191Z","response_time":102,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["progressive-web-app","pwa","service-worker","service-worker-manifest","service-worker-precache","webpack"],"created_at":"2024-10-11T14:07:10.571Z","updated_at":"2026-05-13T00:35:50.700Z","avatar_url":"https://github.com/hubcarl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# service-worker-precache-webpack-plugin\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/service-worker-precache-webpack-plugin.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/service-worker-precache-webpack-plugin\n[travis-image]: https://img.shields.io/travis/hubcarl/service-worker-precache-webpack-plugin.svg?style=flat-square\n[travis-url]: https://travis-ci.org/hubcarl/service-worker-precache-webpack-plugin\n[codecov-image]: https://codecov.io/gh/hubcarl/service-worker-precache-webpack-plugin/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/hubcarl/service-worker-precache-webpack-plugin\n[david-image]: https://img.shields.io/david/hubcarl/service-worker-precache-webpack-plugin.svg?style=flat-square\n[david-url]: https://david-dm.org/hubcarl/service-worker-precache-webpack-plugin\n[snyk-image]: https://snyk.io/test/npm/service-worker-precache-webpack-plugin/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/service-worker-precache-webpack-plugin\n[download-image]: https://img.shields.io/npm/dm/service-worker-precache-webpack-plugin.svg?style=flat-square\n[download-url]: https://npmjs.org/package/service-worker-precache-webpack-plugin\n\ncreate service worker javascript file and manifest by webpack manifest and sw-precache, you can use with [service-worker-register](https://github.com/hubcarl/service-worker-register)\n\n- compatible [sw-precache-webpack-plugin](https://github.com/goldhand/sw-precache-webpack-plugin) plugin functionality\n- support create service worker javascript file by webpack manifest [webpack-manifest-resource-plugin](https://github.com/hubcarl/webpack-manifest-resource-plugin)\n- inject service worker manifest file content to global var `SERVICE_WORKER_MANIFEST` \n- create service worker manifest file `sw-mapping.json`\n\n## Install\n\n```bash\nnpm i service-worker-precache-webpack-plugin --save-dev\n```\n\n## Usage\n\n### create `sw-precache-webpack-plugin` service worker file\n\n```js\nconst ServiceWorkerWebpackPlugin = require('service-worker-precache-webpack-plugin');\nmodule.exports = {\n  plugins:[\n    new ServiceWorkerWebpackPlugin({\n        cacheId: 'my-project-name',\n        dontCacheBustUrlsMatching: /\\.\\w{8}\\./,\n        filename: 'service-worker.js',\n        minify: true,\n        navigateFallback: PUBLIC_PATH + 'index.html',\n        staticFileGlobsIgnorePatterns: [/\\.map$/, /sw-manifest\\.json$/],\n    })\n  ]  \n}\n```\nmore configuration [sw-precache-webpack-plugin](https://github.com/goldhand/sw-precache-webpack-plugin)\n\n### create `sw-precache-webpack-plugin` service worker file by webpack manifest\n\n#### create service worker file based on the specified webpack entry\n\n```js\nmodule.exports = {\n  plugins: [\n    new ServiceWorkerWebpackPlugin({\n      prefix: 'sw',\n      strategy: [\n        {\n          name: 'index',\n          entry: 'index/index',\n        },\n        {\n          name: 'category',\n          entry: ['category/category', 'about/about'],\n          options: {\n            runtimeCaching: [\n              {\n                urlPattern: /^https:\\/\\/category\\.com\\/api/,\n                handler: 'fastest'\n              }\n            ]\n          }\n        }\n      ],\n      manifest: 'config/manifest.json'\n    }\n  ]\n}\n```\n\n### support create an independent service worker file for webpack each entry\n\n```js\nmodule.exports = {\n    plugins:[\n        new ServiceWorkerWebpackPlugin({\n            prefix: 'sw',\n            strategy: 'multiple'\n        }\n    ] \n}\n```\n\n\n## Configuration\n\n- compatible [sw-precache-webpack-plugin](https://github.com/goldhand/sw-precache-webpack-plugin) configuration\n\n\n## Extended Configuration \n\n```js\nnew ServiceWorkerWebpackPlugin(option);\n```\n\n- `option.prefix` : {String}, optional - Service worker file prefix, default: `sw`. such as:\n\n```js\nnew ServiceWorkerWebpackPlugin({\n    prefix: 'sw',\n    filename: 'home.js'\n});\n```\nThe final generated file is `sw-home.js`\n\n\n- `option.manifest` {Object}, optional - The format is [webpack-manifest-resource-plugin](https://github.com/hubcarl/webpack-manifest-resource-plugin). when create service worker by webpack manifest, you must set this config. if `config/manifest.json` exists, will use this manifest config.\n\n- `option.strategy` {String|Array} - How to create service worker file by what strategy. The value optional : `single`, `multiple`, and Array config. default: `single`\n\n```\nsingle: create a service worker file by all webpack entry\nmultiple: create an independent service worker file for webpack each entry\narray type: if the value is array, create service worker file based on the specified webpack entry\n```\n\n```js\n{\n  strategy: [\n    {\n        name: 'index',\n        entry: 'index/index',\n    },\n    {\n        name: 'category',\n        entry: ['category/category', 'about/about'],\n        options: {\n        runtimeCaching: [\n            {\n             urlPattern: /^https:\\/\\/category\\.com\\/api/,\n             handler: 'fastest'\n            }\n        ]\n      }\n    }\n ]\n}\n```\nthe option.strategy[] array item config:\n\n- `name`: {String} - service worker file name.\n- `entry`: {String|Array} - the webpack entry name.\n- `options`: {Object}, optional - the `sw-precache-webpack-plugin` option.\n\n## Manifest\n\n- The plugin will create service worker manifest file, solve the service worker cache problem by manifest.\n\n```\n// sw-manifest.js\n{\n  \"config\": {\n    \"localPublicPath\": \"/public/\",\n    \"publicPath\": \"/public/\"\n  },\n  \"service-worker.js\": \"/public/service-worker.567ddfd3.js\"\n}\n```\n\n- use with [service-worker-register](https://github.com/hubcarl/service-worker-register)\n\n```js\nconst serviceWorkerRegister = require('service-worker-register');\n// The service-worker.js name will get really url address by sw-mapping.json file\nserviceWorkerRegister.register('service-worker.js');\n```\n\n## Relation\n\n fork [sw-precache-webpack-plugin](https://github.com/goldhand/sw-precache-webpack-plugin)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubcarl%2Fservice-worker-precache-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhubcarl%2Fservice-worker-precache-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubcarl%2Fservice-worker-precache-webpack-plugin/lists"}