{"id":20073582,"url":"https://github.com/ragingwind/now-next-pwa","last_synced_at":"2025-05-05T21:30:58.649Z","repository":{"id":35097860,"uuid":"204576314","full_name":"ragingwind/now-next-pwa","owner":"ragingwind","description":"now builder for Next.js with PWA","archived":false,"fork":false,"pushed_at":"2023-01-04T09:00:23.000Z","size":1427,"stargazers_count":6,"open_issues_count":31,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T04:24:45.960Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ragingwind.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}},"created_at":"2019-08-26T23:02:25.000Z","updated_at":"2023-11-01T19:22:53.000Z","dependencies_parsed_at":"2023-01-15T14:00:30.505Z","dependency_job_id":null,"html_url":"https://github.com/ragingwind/now-next-pwa","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragingwind%2Fnow-next-pwa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragingwind%2Fnow-next-pwa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragingwind%2Fnow-next-pwa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragingwind%2Fnow-next-pwa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ragingwind","download_url":"https://codeload.github.com/ragingwind/now-next-pwa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252579993,"owners_count":21771248,"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":[],"created_at":"2024-11-13T14:46:52.055Z","updated_at":"2025-05-05T21:30:58.230Z","avatar_url":"https://github.com/ragingwind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# now-next-pwa\n\n\u003e now builder for Next.js PWA. WARNING, This project is in experimental stage. APIs and others would be changed\n\n\u003cimg width=\"1024\" alt=\"\" src=\"https://user-images.githubusercontent.com/124117/64928886-1f47d100-d859-11e9-9422-f70cd953e0a0.png\"\u003e\n\n# Getting Started\n\n## Set up project and Install builder\n\n```sh\nnow init nextjs\ncd nextjs\n```\n\n## Add code for service worker registration to pages/index.js\n\n```js\nimport React, { useEffect } from 'react';\n\nfunction Home() {\n  ...\n  useEffect(() =\u003e {\n    if ('serviceWorker' in navigator) {\n      navigator.serviceWorker\n        .register('/sw.js')\n        .then(registration =\u003e {\n          console.log('service worker registration successful');\n        })\n        .catch(err =\u003e {\n          console.warn('service worker registration failed', err.message);\n        });\n    }\n  }, []);\n\n  return (\n    ...\n  );\n}\n```\n\n## Add manifest \u003clink\u003e to components/head.js and icon resources under `static`\n\n```js\nconst Head = props =\u003e (\n  \u003cNextHead\u003e\n    \u003cmeta charSet=\"UTF-8\" /\u003e\n    ...\n    \u003clink rel=\"icon\" href=\"/static/favicon.ico\" /\u003e\n    \u003clink rel=\"manifest\" href=\"/manifest.json\" /\u003e\n    ...\n  \u003c/NextHead\u003e\n);\n```\n\n## Configure `now.json` with workbox and manifest custom setting as you need\n\n```json\n{\n  \"version\": 2,\n  \"builds\": [\n    {\n      \"src\": \"package.json\",\n      \"use\": \"now-next-pwa\",\n      \"config\": {\n        \"workbox\": {\n          \"globPatterns\": [],\n          \"globIgnores\": [],\n          \"importScripts\": [\n            \"libs/sw-imports.js\"\n          ],\n          \"offlineGoogleAnalytics\": false\n        },\n        \"manifest\": {\n          \"name\": \"NEXT-PWA-BASIC\",\n          \"short_name\": \"NEXT-PWA-BASIC\",\n          \"icons\": [\n            {\n              \"src\": \"/static/icon-192x192.png\",\n              \"sizes\": \"192x192\",\n              \"type\": \"image/png\"\n            },\n            {\n              \"src\": \"/static/icon-512x512.png\",\n              \"sizes\": \"512x512\",\n              \"type\": \"image/png\"\n            }\n          ]\n        }\n      }\n    }\n  ]\n}\n```\n\n## Deploy to now\n\n```sh\nnow\n```\n\nor you can test in development mode of now\n\n```sh\nnow dev\n```\n\n# License\n\nMIT @ Jimmy Moon\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fragingwind%2Fnow-next-pwa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fragingwind%2Fnow-next-pwa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fragingwind%2Fnow-next-pwa/lists"}