{"_id":"next-offline","_rev":"128-c8e2e20d6e0372ef9a0ba6fc83371f48","name":"next-offline","dist-tags":{"latest":"5.0.5","beta":"5.0.0-beta.11","next":"3.0.0-rc.0"},"versions":{"0.0.1":{"name":"next-offline","version":"0.0.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/zeit/next-plugins.git"},"peerDependencies":{"react":"~16.2.0"},"dependencies":{"hoist-non-react-statics":"~2.3.1","sw-precache-webpack-plugin":"~0.11.4"},"description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","bugs":{"url":"https://github.com/zeit/next-plugins/issues"},"homepage":"https://github.com/zeit/next-plugins#readme","_id":"next-offline@0.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-+pbAA9BiaCcE2AfQI8Zss5XpaV0ORg8fon4G7YBaZVD2MywU8sFrmjKAkRTs72IBw1Mm/ECEBkZknwrnG0ZcOA==","shasum":"6e979cc4d2b01280126491cb166a08fb93f6f1ca","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.0.1.tgz","fileCount":4,"unpackedSize":4030,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBEubc0yqN9Q5vwRkRxDOdlyrVGC+iGSsnKRpqoD+xs5AiBS+nj2oWCyFLGsCXLluNpsrX7FWff6Ob2f15e4ugIVnQ=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.0.1_1518027532561_0.6668546678144671"},"_hasShrinkwrap":false},"0.0.2":{"name":"next-offline","version":"0.0.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/zeit/next-plugins.git"},"peerDependencies":{"react":"~16.2.0","next":"~5.0.0"},"dependencies":{"hoist-non-react-statics":"~2.3.1","sw-precache-webpack-plugin":"~0.11.4"},"gitHead":"ff942312dd09c0242256c78fb8a3e6ea19f6943e","description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","bugs":{"url":"https://github.com/zeit/next-plugins/issues"},"homepage":"https://github.com/zeit/next-plugins#readme","_id":"next-offline@0.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-6kLxED/tJXnJ/QMgG4uW6yd22BMyEe2TejWKphC6mgJ5PcbSDXbidkE6Y2cnAmSExj9Qqi31XWWzdIfGGY+XHQ==","shasum":"bd533fd04106080170f82287ff069a255d659572","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.0.2.tgz","fileCount":4,"unpackedSize":4034,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0UIIgyo8xKSpb2fEyFjeR1QmN92oa7iqBPQ/eihCx/gIhAJLpGrTbiqDXyiRc7Sj6vB5b6vyF6ChOe7fQvLoatZMb"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.0.2_1518028722009_0.27717527838271994"},"_hasShrinkwrap":false},"0.0.3":{"name":"next-offline","version":"0.0.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/zeit/next-plugins.git"},"peerDependencies":{"react":"~16.2.0","next":"~5.0.0"},"dependencies":{"is-empty-object":"~1.1.1","sw-precache-webpack-plugin":"~0.11.4"},"gitHead":"2241ba278bd0bda1cd1a0ef0cb3da1d8e8c7f773","description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","bugs":{"url":"https://github.com/zeit/next-plugins/issues"},"homepage":"https://github.com/zeit/next-plugins#readme","_id":"next-offline@0.0.3","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-J9jpoccB8/mfA6qlyrAizHRnvRlD5+0W2bqCDeIOzba9KBy17T0dXezvU6bglf43WL2J/JqpJn00eCvA8FXhew==","shasum":"17d8fd799386dc67ff2185b9084fe94a797fe7f8","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.0.3.tgz","fileCount":4,"unpackedSize":5295,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHSN6Zbjb89XHLvL16GipBse9fX3RKmDwLLelykEmttHAiEAvEspUSngIX/fryKSwTTEg0lt6ADz4mb5bOiXfzyQcow="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.0.3_1518036028243_0.7391113521914132"},"_hasShrinkwrap":false},"0.0.4":{"name":"next-offline","version":"0.0.4","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/zeit/next-plugins.git"},"peerDependencies":{"react":"~16.2.0","next":"~5.0.0"},"dependencies":{"is-empty-object":"~1.1.1","sw-precache-webpack-plugin":"~0.11.4"},"gitHead":"48240527340ca6dc93602dfaf485cd9cd32d0eb8","description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","bugs":{"url":"https://github.com/zeit/next-plugins/issues"},"homepage":"https://github.com/zeit/next-plugins#readme","_id":"next-offline@0.0.4","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-K+3kl1Zo+fXEqhEiMqNkymzXOqDFnPEAcgH87qfD9hS+upLM3sE1oQ3TTHV+7Th4oMMNsT08p7STRC+34u6AuA==","shasum":"d39e213d29022fb4907e75a6a142e702849bc9f4","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.0.4.tgz","fileCount":4,"unpackedSize":6122,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEyElT5OI3fUHaEcNTD1rl7WjN52kxnqSCr0EmNSX9TxAiEA8irsHaDT1e4AJ9UgRRDSDfyqzi3BmdDTSfKxjFMejaQ="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.0.4_1518037336536_0.9009017190012831"},"_hasShrinkwrap":false},"0.1.0":{"name":"next-offline","version":"0.1.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack"],"peerDependencies":{"react":"~16.2.0","next":"~5.0.0"},"dependencies":{"is-empty-object":"~1.1.1","sw-precache-webpack-plugin":"~0.11.4"},"gitHead":"460ec6188043efe64b47309de0bb4a0626ef723b","description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-BB1xD+Bp8NbTUhGN8HOsq1WI6JBH8xOdiXEfXykVTauJhvoPk/xhkyP9ooUJymaOIbq6UuWVLZ7dsKYa4rnL9Q==","shasum":"17dd0c2363d8626b09da6fe00a44d7d483b54392","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.1.0.tgz","fileCount":4,"unpackedSize":6589,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnIgywdFXU6+W7TNWhm9Zon2R240zURwgnlHp+Tn2xfQIhAPXGV4tORKeATC3efNOjJ2sEENw4wORvJxYZZiHb+cpF"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.1.0_1518037838411_0.4644912264099852"},"_hasShrinkwrap":false},"0.2.0-0":{"name":"next-offline","version":"0.2.0-0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"is-empty-object":"~1.1.1","sw-precache-webpack-plugin":"~0.11.4","workbox-webpack-plugin":"~2.1.2"},"gitHead":"20a5283c838f1ed59d0472d36a7f79a159bf3cce","description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-0","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-gXmMVaYBxqROj0SGWeTtBf2qtVGfFinCpM+7FRN5Nxzt4yhIs8slI0nU0DMI55hpQmUDoIjXLiyDa+ghgrWb4A==","shasum":"ab4c9fefd46c900b9dd4c0fce2df3be7a273d78c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-0.tgz","fileCount":4,"unpackedSize":6698,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGeeeiot2f9rqPv/N1ysi8wD7FN/tve5SnkFbgWLYtyjAiEA2J3mfiX3AzFqDpR/XrOSe+VyFy9yMg84W71JAxHlcm4="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-0_1518486622949_0.012050434143460631"},"_hasShrinkwrap":false},"0.2.0-1":{"name":"next-offline","version":"0.2.0-1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"is-empty-object":"~1.1.1","workbox-webpack-plugin":"~2.1.2"},"gitHead":"20a5283c838f1ed59d0472d36a7f79a159bf3cce","description":"Use [workbox](https://developers.google.com/web/tools/workbox/next) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-1","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-TB5VNU9kvhy9ecCgWDRYbSOHpegu7F5b+SaufCP+MxGLzP1mFJ/vp3H2DUlkB1v4IF3YfxHVXT2+KFsEYmdYmg==","shasum":"9780a36af007a44b3b209e4ef78a0c170969b94b","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-1.tgz","fileCount":4,"unpackedSize":6676,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFVA0xcdHVFxn6wsSmbUBwTP1SNlSq9EUm6TwDXIj4mAiEAwC0du384WSin9A/2VMdku01GgwFgvTbgaTusykaWCGc="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-1_1518488382547_0.8397593359481843"},"_hasShrinkwrap":false},"0.2.0-2":{"name":"next-offline","version":"0.2.0-2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"is-empty-object":"~1.1.1","workbox-webpack-plugin":"~2.1.2"},"gitHead":"20a5283c838f1ed59d0472d36a7f79a159bf3cce","description":"Use [workbox](https://developers.google.com/web/tools/workbox/next) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-2","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-64JGtt8+dXj7mUadgSSvd3SM0Dpv97oVvnwCbb2aVCDJRMDxqFoatx2GGxIddRshE8Snsy8K1JPBjqXld28pAw==","shasum":"8c2f5077099747f033d42c39591d0700760b7c64","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-2.tgz","fileCount":4,"unpackedSize":6673,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1eJj5bFYfjoiIW7APMTGUxukVHun/GQqNZkeuqiZddAiAfRhzvMv9TqgXduC7VSxmAuqgBXGyESS0BmMHikZ7Fag=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-2_1518489309913_0.9939962791579864"},"_hasShrinkwrap":false},"0.2.0-3":{"name":"next-offline","version":"0.2.0-3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"is-empty-object":"~1.1.1","workbox-webpack-plugin":"~2.1.2"},"gitHead":"20a5283c838f1ed59d0472d36a7f79a159bf3cce","description":"Use [workbox](https://developers.google.com/web/tools/workbox/next) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-3","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-KRjFT2owqRuwFwL9Ob0Wxv4RKqLQvMCViFHRjd4cmv9MDl+b/ifb4p4+kKoSkkAL+50hCUvywBADJpTVW3t/vA==","shasum":"8b66897cd9f7d4210262d3b700739e5f0d32c27a","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-3.tgz","fileCount":4,"unpackedSize":6734,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICilY4fmOrk0qhMNBJXInflxaoUBINh4w0HIfPYwmEgYAiEAh886iMKDg3lyB5blverA5iTXxAq0v+7Bh3+Um35j4co="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-3_1518494605485_0.6999674082641727"},"_hasShrinkwrap":false},"0.2.0-4":{"name":"next-offline","version":"0.2.0-4","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","sw-precache-webpack-plugin":"~0.11.4","workbox-webpack-plugin":"~2.1.2"},"gitHead":"20a5283c838f1ed59d0472d36a7f79a159bf3cce","description":"Use [workbox](https://developers.google.com/web/tools/workbox/next) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-4","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-iqze55Zd4K4JT2r84IEgJiWY2/tFqXfaICnAkSttI7Wvy6Ix5DS2PkNzjRqocO3zvCc2L9R+oLO6+HDNH3VvPw==","shasum":"73527dd704ac910f2bf77ecf80366719fc43b05f","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-4.tgz","fileCount":6,"unpackedSize":10533,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB4Eu7h2VecjEk99QzzreANvCvLAwwD/18gkMx/I/HJwAiBXBQLY4vbxIiYSQz7IsQt+Xg3XYVzObf1jEvp8SrcXtQ=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-4_1518503060204_0.3898585863744646"},"_hasShrinkwrap":false},"0.2.0-5":{"name":"next-offline","version":"0.2.0-5","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","sw-precache-webpack-plugin":"~0.11.4","workbox-webpack-plugin":"~2.1.2"},"gitHead":"20a5283c838f1ed59d0472d36a7f79a159bf3cce","description":"Use [workbox](https://developers.google.com/web/tools/workbox/next) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-5","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-obDkNF6SqwjbdYPYraqc/XbZgY8eEBjbvkNjoNclpVNwEGHqEtwJMqpdkXsxLX1K9rweuARpWxnzl2FIhoa+lA==","shasum":"a6acc69fbfa4212108c6fceb8275549b93541217","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-5.tgz","fileCount":6,"unpackedSize":10537,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCz3F7bsxtefVkz66TSCEhhnSU5jPyr5O1HbUxg/ifqSQIgRX+UcaKtAgvgLer7msCkeV3KEidKHS4J2Ps+RtBprwg="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-5_1518503576428_0.8107564645511947"},"_hasShrinkwrap":false},"0.2.0-6":{"name":"next-offline","version":"0.2.0-6","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","sw-precache-webpack-plugin":"~0.11.4","workbox-webpack-plugin":"~2.1.2"},"gitHead":"20a5283c838f1ed59d0472d36a7f79a159bf3cce","description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-6","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-pOf0twqFU+TavBHaO658glHmTUZfM//0Z6IRQRN77hFCmbKyXDtYauQuGdHL0OVhIhyms1EhglzE1NwxpXB/xQ==","shasum":"557c40d356574f576cf13ea0933537a32846257b","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-6.tgz","fileCount":6,"unpackedSize":10548,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZbTWXtqSruL8d+2FXYHgSj9TIezgb+oJ/AL02bh1/IgIhAPNMDv/2z2yAGSp08VW+d9PK39DQQSVPzSC+hYSwR60b"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-6_1518503786998_0.30445349402154"},"_hasShrinkwrap":false},"0.2.0-7":{"name":"next-offline","version":"0.2.0-7","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","sw-precache-webpack-plugin":"~0.11.4","workbox-webpack-plugin":"~2.1.2"},"gitHead":"20a5283c838f1ed59d0472d36a7f79a159bf3cce","description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-7","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-JU+m7D1XU96ez8/ZAPVoWD+BNjg+uns+VLYzwIVEJtGQ8fbxbMOdrNSKAkP7BvLxNTxUGG5FHZpN2U3F3Hg9mg==","shasum":"5cd817c9397cc89565a7aaccd56d1917a02b2f98","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-7.tgz","fileCount":6,"unpackedSize":10570,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7Z6bB5WVAoiRwyL4xDUxKqKCPkK26/COjLcXneVC8qAiB4c84bW0evjw2fJHkhErJ2c7rXtRx0xAqrJUUZAhV3zw=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-7_1518506562269_0.065695215258887"},"_hasShrinkwrap":false},"0.2.0-8":{"name":"next-offline","version":"0.2.0-8","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","sw-precache-webpack-plugin":"~0.11.4","workbox-webpack-plugin":"~2.1.2"},"gitHead":"20a00707e6d39f8b6cc8d723258536f6c5585dec","description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-8","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-tfxDzMJn97KxOtmn7v4hBHlLWRL4TfJTVRSKvtQLQIm/toombTSO+HozJyeP/D009Lc7fGBTsHGR9RMTzqm0VA==","shasum":"3ae3cf78ccadf4cac33c8870580967125a3cd70c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-8.tgz","fileCount":6,"unpackedSize":10879,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSAJj3/RHMxGD0jfhlmxXkLGEprt51qsrZoTxY9fkfvAiAq0vZLdJZqGwtJctl2demyOf++guTJyvi4WtI3CPKLZQ=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-8_1518544280794_0.899395576689209"},"_hasShrinkwrap":false},"0.2.0-9":{"name":"next-offline","version":"0.2.0-9","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","sw-precache-webpack-plugin":"~0.11.4","workbox-webpack-plugin":"~2.1.2"},"gitHead":"964b5cf6f13459ca7d1c37b95e9d9004e8381f63","description":"Use [sw-precache](https://github.com/GoogleChrome/sw-precache) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.2.0-9","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-vgkC40UhFLVHruQ9chKPJUa7FER5n3ZXWYkC8PfNJ6YfiR7ZiND8Eu9rsj0EHwxIoxqCrOy+mKi8VlZru4TKXg==","shasum":"a518d9d9e2aab9cd9f368d3fd8a695fe503e1431","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.2.0-9.tgz","fileCount":6,"unpackedSize":10895,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwr/uSRnBHcP99wm7GlCHTkIYxLKtpAL0QBLU0ytTtaAIgd9tt8A6G7drEljVIjGadr+r4lZNHsosam1CCCeVemO4="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.2.0-9_1518555893293_0.7342846368566847"},"_hasShrinkwrap":false},"0.3.0":{"name":"next-offline","version":"0.3.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","workbox-webpack-plugin":"~2.1.2"},"gitHead":"f57ed42b2597a0f1373115e7f20289e848a53d87","description":"Use [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.3.0","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-UHbRboZgl3HSpVvMVvWYVzSustKx+di64MR1414SbMldNzXIjo2b0Req93c9O4b1vKjScAbuH9y9kpcawd3QXg==","shasum":"a00255283ae5b9f1ba6e977bb6d6657a2ed3accf","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.3.0.tgz","fileCount":5,"unpackedSize":9359,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBFSKejo7wAAnah0y41hFokOQ7TiXz5r2TqV+7xjTSKPAiBwX9ZTT1+a3i1W9fzHSt8lc9B4htygp5ThPfR0TJEvxg=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.3.0_1518592322840_0.3840540277232287"},"_hasShrinkwrap":false},"0.3.1":{"name":"next-offline","version":"0.3.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","workbox-webpack-plugin":"~2.1.2"},"gitHead":"f57ed42b2597a0f1373115e7f20289e848a53d87","description":"Use [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.3.1","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-A6U28J1kIwk/mAtIcLzynsqTRTJMmB4vl7P350OolIdNKYO7xnGWFmTd2csFeq8j3lxLGdVyv+vdrHu86lmiiw==","shasum":"4ac1f2574160d6b9f6e4218e70580c7355ca663c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.3.1.tgz","fileCount":5,"unpackedSize":9242,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4gtvalnLpOeIVmK8nZXMp9f7X62iEoA46ENmYUHk1rwIgKdjtUmBLx6cR53Byfs4vUFvswfxywu6/+VnCfSSH7/o="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.3.1_1518592621299_0.774876587186961"},"_hasShrinkwrap":false},"0.3.2":{"name":"next-offline","version":"0.3.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","workbox-webpack-plugin":"~2.1.2"},"gitHead":"f57ed42b2597a0f1373115e7f20289e848a53d87","description":"Use [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.3.2","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-pQ8yOViX8xoyyYqBr2t0FF0K3qq7ZrN3maBV5L7BFfZwmPmGIcu9SRbN9/zbQbrmxyn38cD6ucNmPsxqBXrALw==","shasum":"fa23eba1565d9be5ffcb401b3a4992697c992825","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.3.2.tgz","fileCount":5,"unpackedSize":9211,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDy1TKU28XIm4wrJCrZEl/ZdyUZcSYaotho901TqPr3KAiEAhFwbYVGz6N4ymS3dBWyg6Vg/1JchySoOq8GaZEBkrbQ="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.3.2_1518592887908_0.19527755708390604"},"_hasShrinkwrap":false},"0.3.3":{"name":"next-offline","version":"0.3.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","workbox-webpack-plugin":"~2.1.2"},"gitHead":"f57ed42b2597a0f1373115e7f20289e848a53d87","description":"Use [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@0.3.3","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-sX3xVR7/6ziETfDLghxAWnN8+R/raOH9CgaI/LtivsnDfkZ9LWOvlUk9RMIMLbqZl0cxLTuBGX0ljF0KWvtx3A==","shasum":"136f9aa1776bf7f2165be9824b22e1e962af467d","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-0.3.3.tgz","fileCount":5,"unpackedSize":9214,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDtW4dInQe3TOBFkfOnIcAf+Z7bZ7x0kczhBqlmUwnH3AiBronKvtY1NeXDt3slZENUj5BE8GqlTxyxppuLw88kjIw=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_0.3.3_1518594741293_0.3745922170663165"},"_hasShrinkwrap":false},"1.0.0":{"name":"next-offline","version":"1.0.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"globby":"~8.0.0","is-empty-object":"~1.1.1","load-json-file":"~4.0.0","workbox-webpack-plugin":"~2.1.2"},"gitHead":"5afa39867da2d0c1b549dfcef1e430dbc5b63d82","description":"Use [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-mUAJUz7CjQx4ahWJG3wuevOnIpGJYjRmM2IrKcMR28ZaW+pdyj6UZLljQwDP58evKT888VBoG9ZcDEdWapzLNQ==","shasum":"6b2172db848f9f6923c6c755d79d463b229b9599","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-1.0.0.tgz","fileCount":5,"unpackedSize":9211,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH7uFgWH8Gq0QSMi5/IDK9zH7R9YeiKDwsna2NxbJBStAiBliq5CJ47wlPvrR2HjaLv6DUFGZt0u6Skd/OeBn8RLGw=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_1.0.0_1518595456423_0.7572501016968163"},"_hasShrinkwrap":false},"1.0.1":{"name":"next-offline","version":"1.0.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"load-json-file":"~4.0.0","workbox-webpack-plugin":"~2.1.2"},"gitHead":"8724e4563da44f9f6d47ae9e2ae93aa3efa631cc","description":"Use [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-ZmcuEXQo0qv9gFtRYAQ85N2BVAaiO5xrEXRf8QIQxj7xHK9jYG05bk+pc6S2unJdL3yXmgI1XpnTb/tHGCj9ww==","shasum":"0743c50a0f178a8c2f812a810885f72a3181b6d4","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-1.0.1.tgz","fileCount":5,"unpackedSize":9303,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFOHrao4+SY//XVqpaOJHcAdhbFKCQaJpxw0prU9VLzNAiEA8ThCMN4BxY0axvXG5bptGpAWtCypeXlsZRlbCHZgSWc="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_1.0.1_1518640534727_0.18589851474055386"},"_hasShrinkwrap":false},"1.1.0":{"name":"next-offline","version":"1.1.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"workbox-webpack-plugin":"~2.1.2"},"gitHead":"3e3c9285242178932739f2e2ebe61b35ae6d0da5","description":"Use [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-3U7h4QXPp36OpcCevKzeubQG1rxOfVPbMlu6TIUONO5giyXq48ZLS0/DxVGgytSI45E+34eLs9KLk3cVngZcMw==","shasum":"2935ac0b5b3347949c5696a5be8d0fd7cd47aca4","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-1.1.0.tgz","fileCount":7,"unpackedSize":9110,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGfv9pe9tddPLvf4BqNR/v0RmnNo/Uo+x+MAeWbcB0JyAiAKqHptHL+DmVM2z6+Vuq/bsr1vA7usgS7+/jx9l5nxuQ=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_1.1.0_1518657415461_0.33051506506144657"},"_hasShrinkwrap":false},"1.2.0":{"name":"next-offline","version":"1.2.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.0"},"devDependencies":{},"readme":"# next-offline\n\nUse [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst next = require('next')\nconst { parse } = require('url')\nconst { join } = require('path')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\n<!-- The default object passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-webpack-plugin-WorkboxBuildWebpackPlugin) is here: -->\n```js\n{\n  filename: 'service-worker.js',\n  placeholder: '${precache}',\n  serviceWorker: ''\n}\n```\n\nIt can easily be modified by passing a `offlineOpts` object to `withOffline` in your `next.config.js`\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\nmodule.exports = withOffline({\n  offlineOpts: {\n    ...\n  }\n})\n```\n\n<!-- ## Custom Service worker register script -->\nBy default `next-offline` will register a service worker with the script below\n<!-- , this is automatically be add to your client side bundle once `nextOffline` is invoked. -->\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n<!--\nYou can pass in your own custom service worker register script by using the `registerPath` option like this:\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\nconst { resolve } = require('path')\n\nmodule.exports = withOffline({\n  swPath: resolve(__dirname, 'my-service-worker.js')\n})\n``` -->\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"a1e99eea389efa4e497aa0c8cb3692112f315ef6","description":"Use [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-oZBPuNR+YH/cLQEMJkbVhmiA8juAtz5XXMCllLsnTmZQwkxYmyZJH/wVDDjo4SnSTfyat325CmEnSSXr+weefA==","shasum":"e5c0e44c142da44d8eed6c36b2fbb6841a2d3f3f","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-1.2.0.tgz","fileCount":6,"unpackedSize":8795,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGiJ0k4ignhCcIy83ogwqnuggC1gg2VpDWGwwUgCb0OvAiEAr3RqtV5mvYAhmtKxLBcbqvbfpYK3nvZujngZCWuMq5w="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_1.2.0_1518723037987_0.7033314417681349"},"_hasShrinkwrap":false},"1.2.1":{"name":"next-offline","version":"1.2.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.0"},"devDependencies":{},"readme":"# next-offline\n\nUse [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst next = require('next')\nconst { parse } = require('url')\nconst { join } = require('path')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\n<!-- The default object passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-webpack-plugin-WorkboxBuildWebpackPlugin) is here: -->\n```js\n{\n  filename: 'service-worker.js',\n  placeholder: '${precache}',\n  serviceWorker: ''\n}\n```\n\nIt can easily be modified by passing a `offlineOpts` object to `withOffline` in your `next.config.js`\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\nmodule.exports = withOffline({\n  offlineOpts: {\n    ...\n  }\n})\n```\n\n<!-- ## Custom Service worker register script -->\nBy default `next-offline` will register a service worker with the script below\n<!-- , this is automatically be add to your client side bundle once `nextOffline` is invoked. -->\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n<!--\nYou can pass in your own custom service worker register script by using the `registerPath` option like this:\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\nconst { resolve } = require('path')\n\nmodule.exports = withOffline({\n  swPath: resolve(__dirname, 'my-service-worker.js')\n})\n``` -->\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"a1e99eea389efa4e497aa0c8cb3692112f315ef6","description":"Use [workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js)","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@1.2.1","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-wwdSH9R7WIPWs4hV+qPF10HA/bNyzY1PFNFZBq7AZlN3Q9cNq/vLUuKdXswI1dZlNWdj1JKMNYiFbOsvWBsPyQ==","shasum":"a5e97d8c805c8f2bd7c50529adf1cfa2fc254225","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-1.2.1.tgz","fileCount":6,"unpackedSize":8798,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHDKHUIOdTlBX+Beer7DGnrPEvDx/gSBn2Y6hJhJoto9AiBtaHpFvoxbewFmbI49iGp8yshYQ97SFKNQvl5vQQvfvA=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_1.2.1_1518723094740_0.9390372350298595"},"_hasShrinkwrap":false},"1.2.2":{"name":"next-offline","version":"1.2.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.0"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable your application to work offline.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst next = require('next')\nconst { parse } = require('url')\nconst { join } = require('path')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' }\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n          statuses: [0, 200],\n          headers: {\n            'x-test': 'true'\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"a1e99eea389efa4e497aa0c8cb3692112f315ef6","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable your application to work offline.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@1.2.2","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-DtmIl9NcqxGocFNKMgmdOWCe9nyKahAnkXzSUOo4slM4NHjLwiuv10aOiIttP4nG6MBObrW20G8n2fP5YNMJ2A==","shasum":"70b3c6ed5a5ca51405dcf119bb499730ec927e5d","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-1.2.2.tgz","fileCount":6,"unpackedSize":9117,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZrYH3El3j70MTr7Pd2XbLzJJ+hetWk2m44a5o2T5Q1gIgbza5U80TbxMMeBCrU0+z4EtY4OzVGXCaKhxEsxLX/DQ="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_1.2.2_1518729195157_0.11512447674632464"},"_hasShrinkwrap":false},"2.0.0":{"name":"next-offline","version":"2.0.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.0"},"devDependencies":{},"gitHead":"96505cd1843d4a4eaa19ea113fc5296a7993aab1","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-U2pg2XpeAJzUYldHNaipB3bHom8iukfZHLD9TlsUETxnQzwD19hFJiezF8/D4BPbxpxSd96WrmAcODz22EqO+w==","shasum":"6335a174dd1bfa41a046cb277bbc3b4729673775","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.0.0.tgz","fileCount":6,"unpackedSize":9119,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDul3n6ix2zIoIUxQJgsrhBcrK7t1CMQH3a1wrA1mcm0AIgc751Drp8SQY26wKckg0FH3qedMdh5FxTq/it8QX1CSs="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.0.0_1518729991627_0.5517270070536142"},"_hasShrinkwrap":false},"2.0.1":{"name":"next-offline","version":"2.0.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.0"},"devDependencies":{},"gitHead":"3424c9648d9100d5f816f3e1410c3b011393026d","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-H3NRk2O2K44XI80ffDb5p5/oLmeMhrIgj2xPBv6YMrk7V/6Ht1pGfKRzaBjNm337CJJGwXfb1/jBwqcISmePOw==","shasum":"f2602e9362d2a1c7a7143c7697430ff80b27a2ae","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.0.1.tgz","fileCount":6,"unpackedSize":9050,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF3A7OjRA19Z7tP8fo7dJDqAMWdCZ1CpPWgbDYG7ikgRAiApLKUpdzAHpJNIcvnN1pEJ34NNMzb3gmPisS9Osn8t8Q=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.0.1_1518808062111_0.6038582221062412"},"_hasShrinkwrap":false},"2.0.2":{"name":"next-offline","version":"2.0.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.0"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n          statuses: [0, 200],\n          headers: {\n            'x-test': 'true'\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"3424c9648d9100d5f816f3e1410c3b011393026d","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-81Di+OP1u2rq5k4t3DkY2FgsMPjliURqAtR7SS9Cc54SrxOnQQqZjJcT7kt+3WBji8oLXU32bJZemY7koh2/rw==","shasum":"d9d72d4a199deb3f020668ec3d8ac54487b7479b","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.0.2.tgz","fileCount":6,"unpackedSize":9207,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCD0pJTKvph4n68gECNMgZLRbgwCYjKiIeHqtv8ALuNzwIgcZ6Zde9sUWKwLty4iPGvyeNZHKFg3qgX2BcJ0mrW/wM="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.0.2_1519067358673_0.300277758778388"},"_hasShrinkwrap":false},"2.1.0":{"name":"next-offline","version":"2.1.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.0"},"devDependencies":{},"gitHead":"ecc8fb3732a66dbc3d1344806e4583a46365ad06","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-4qDlpx6gPSSNJYnt4f+KUMWxXaFEQyqrnGjFLL51ngvVa/wIDTiFxbHh8s5UhqK/ORAkV0zlK6CK2BwwEDjqWA==","shasum":"c950965d54eb917eab114ac0cbce1b7b6b54f755","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.1.0.tgz","fileCount":6,"unpackedSize":9207,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpwv7h3Eb/QIlelY/+7r0D5hxykACTeXbp2hgx8nuXegIhAMAPS9JDg1FgPUipT/azfFRHPrGvHQPq5UnovfUiVtgy"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.1.0_1519067690468_0.3602552328303956"},"_hasShrinkwrap":false},"2.1.1":{"name":"next-offline","version":"2.1.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.0"},"devDependencies":{},"gitHead":"bfe6f0e857990735cee5c66c2e1d620347ff436a","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.1.1","_npmVersion":"5.6.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-FrnShiqVmp+fFSH/yJWISSW7TfcGLo3Nt66A8ncD2rgAo8a3tMOy2nj6AJLmtfrQlYrzMpQ5i6OciVL5KNJDvg==","shasum":"212ed92b3db1a4f241f340284c6ecee653b5c7e9","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.1.1.tgz","fileCount":6,"unpackedSize":9213,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHcozp1tq8wciL6AfgL13biOhuseuLg4at+1R+3Pj/yoAiA6gJgDHWmJV9I6R/w/OdXhUayoGhIPTuYb+Z8iKHCB8g=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.1.1_1519245163156_0.12775196611748396"},"_hasShrinkwrap":false},"2.2.0":{"name":"next-offline","version":"2.2.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.2"},"devDependencies":{},"gitHead":"3e0f9607231c67433e665f35e363ec815ad821b6","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.2.0","_npmVersion":"5.7.1","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-k2W48mV8xvsC86zYNhcsJc7nCWe2VvFp+eYzQFgwJ5mP3JNRwMj6c0LvfiapiqBKBqKwXwRw0846rjtRmttAxA==","shasum":"d4792f827f1f7d5bdf5482f4365d486107af2048","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.2.0.tgz","fileCount":6,"unpackedSize":9233,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEcZ2yMzUdAuw9MroAfqJvk/0dYqfz1vGJDRuxhnHIXAIhAP35JUHlsiwD7QdIw0c8g4PGA2YjsEESbtlUzvXc0owU"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.2.0_1520536829867_0.4076849673001719"},"_hasShrinkwrap":false},"2.3.0-beta.1":{"name":"next-offline","version":"2.3.0-beta.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.0.1","workbox-webpack-plugin":"~3.0.1"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"3e0f9607231c67433e665f35e363ec815ad821b6","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.3.0-beta.1","_npmVersion":"5.7.1","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-KyMSvXFcuhsrdzTS7Y505IR76KJQU2j5yHA7sx1LzkUDbj6DNXE1StuG94QVJ2rMaavt2acwgeNKiGAd2NZcDg==","shasum":"bd9db32162fc8a87ec35eb28b529ed74b239a21c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.3.0-beta.1.tgz","fileCount":6,"unpackedSize":10820,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwB5v1ImZZy8M7+xvy/keCPAmWZo8UUPMYj04zyBfuUgIgEeP4LnYD6b1fcR4ZpyRp7JLH7sB3w5WD60oY0jXcnro="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.3.0-beta.1_1522047935372_0.30467420264106604"},"_hasShrinkwrap":false},"2.3.0-beta.2":{"name":"next-offline","version":"2.3.0-beta.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.0.1","workbox-webpack-plugin":"~3.0.1"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"3e0f9607231c67433e665f35e363ec815ad821b6","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.3.0-beta.2","_npmVersion":"5.7.1","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-dPEUPbbJvm1rCD1ml55LMEZeokQoqNv5S5sANFWSoSLv0GUxYpZygpgpiXI2STxRM+4yclpB8vHgAtyqN4rm0g==","shasum":"fda374db55b5c643bf0776d795b0b33f6f7ab870","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.3.0-beta.2.tgz","fileCount":6,"unpackedSize":10889,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFNuKaLZNHTt6KE8gLV7D/VhlqHJEFietFz+bl9EO9vjAiEA+ZQTGRMbF0TMxv1pBeiWLKx28BnlnlkLXYvdWLM+DmA="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.3.0-beta.2_1522048935577_0.6255659289503877"},"_hasShrinkwrap":false},"2.3.0-beta.3":{"name":"next-offline","version":"2.3.0-beta.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.0.1","workbox-webpack-plugin":"~3.0.1"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"3e0f9607231c67433e665f35e363ec815ad821b6","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.3.0-beta.3","_npmVersion":"5.7.1","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-Z6GQpPOMxSK67rOqTpaKk/cASG1yx0U7ghwx2syFlnEkT/K4bQl8d9Vukgg77a3R4WGfuodQaAlnsmo17lNJcg==","shasum":"b84a083d6a692568a7e5bbcfe5c0af2d9e652c74","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.3.0-beta.3.tgz","fileCount":6,"unpackedSize":10909,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHyq/eB6g0cevoy764VoiZzuvvLl/2+jzMHZqtv+oUN/AiEAp+Am2sIYWkIq1FsyJhLwaIZoCDAHa9qB/7EatPHw+/E="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.3.0-beta.3_1522049345787_0.5639775778920952"},"_hasShrinkwrap":false},"2.3.0-beta.4":{"name":"next-offline","version":"2.3.0-beta.4","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.0.1","workbox-webpack-plugin":"~3.0.1"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"3f81a642c39fcfa4eb197aa3516ac677cca3d1c5","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.3.0-beta.4","_npmVersion":"5.7.1","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-LQJCBr8to6Hot+AYAZ8KNzdohn8GNW/BRytgkSkoN3mpFxiZImTE4QbScP107KgBIafVr2zgsgQ8c3YVn3GVVw==","shasum":"83f939f9d2347e13969a45c747921c0c00c0bb5b","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.3.0-beta.4.tgz","fileCount":6,"unpackedSize":10819,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+YF+SJWQKivRSSZ6dTX6DHQkgsB/OKM2+LOe627k75AiEAxkQfraHwfzhMXOSCTvl1LCwfWpX25cE7pFGvqH1gaUw="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.3.0-beta.4_1522052327826_0.6437254222541087"},"_hasShrinkwrap":false},"2.3.0-beta.5":{"name":"next-offline","version":"2.3.0-beta.5","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.0.1","workbox-webpack-plugin":"~3.0.1"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"3f81a642c39fcfa4eb197aa3516ac677cca3d1c5","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.3.0-beta.5","_npmVersion":"5.7.1","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-jEVGVhTuQoMrM7IcOEk4rMGSeMe6AxttPq0S9KuqafquPPdmU+sQxO4MqYkT8Shwb6CW6GeHwbSU2xE8DY/yDQ==","shasum":"57344a611f36eb7b41853a82b43f236423734f8b","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.3.0-beta.5.tgz","fileCount":6,"unpackedSize":10856,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVZm6IJL+P8PpeZ0T8zvyfQH9fCOPY7tk6PK05JLg4+gIgU/SWCCrCkcA8VMtORTD/Sr+TqAhk63PY/g4zOBr4R64="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.3.0-beta.5_1522083529762_0.24806922577990376"},"_hasShrinkwrap":false},"2.3.0-beta.6":{"name":"next-offline","version":"2.3.0-beta.6","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"~5.0.0","react":"~16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.0.1","workbox-webpack-plugin":"~3.0.1"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"3f81a642c39fcfa4eb197aa3516ac677cca3d1c5","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.3.0-beta.6","_npmVersion":"5.7.1","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-GnG0Lqrn9nsbxJYXwYvVu4nwmpBsMZS0KDr/PXG6kWJk8nZEfvrrgxV+whKPX+0IOc3Jeb9xUvIX7ZMXe6ey6w==","shasum":"cf547a4d8d5db4673eb45285c7422f9f8c74932f","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.3.0-beta.6.tgz","fileCount":6,"unpackedSize":10849,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyorC7sr9328bdRuaP6AMBwyQMDxDkCJt2c/Ba6H+amgIhANP1Hp9M8uMaoMHA/LPDBzY/Z1zaB6GxaUuRS+9r2p/m"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.3.0-beta.6_1522083968015_0.08857043067746373"},"_hasShrinkwrap":false},"2.2.1-beta.0":{"name":"next-offline","version":"2.2.1-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.2"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"29c9b096f1688d0d5357315eeff88b946a265269","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.2.1-beta.0","_npmVersion":"5.7.1","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-Qv0LyBL7g9RLwtomlmUkh+V0RufVvdb5nhh63M1wAgvF9PHLbULvx7leuZxCxh7MlaIXzph0A+UM0U5PsEWYeQ==","shasum":"64905c1142d9e8ffcf326c5e72f632443b31b176","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.2.1-beta.0.tgz","fileCount":6,"unpackedSize":9240,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0IoQKL2L7pyyfc0BuLxD8HyHZSHMYQYAESnPVAA6JbwIhAJOfcj5NgRg31TYHD7zYo2RVrOP/5oXqyg8Ywaxclai8"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.2.1-beta.0_1522168927461_0.8286970365208328"},"_hasShrinkwrap":false},"2.2.1":{"name":"next-offline","version":"2.2.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.2"},"devDependencies":{},"gitHead":"18ec387fb9ba9859e2aa4d8380e2d138bbb1d856","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.2.1","_npmVersion":"5.7.1","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-dJzL6yLrGMhae0mFGdLAA4zfJzJrX6EisanGQKHocpgEgDLjkAzwTRZ+4ekAFIC0qdA7ulXeGKVxH9Mwf8KyKA==","shasum":"b415fc0a3d7986519052b07b38632c62dd0da67a","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.2.1.tgz","fileCount":6,"unpackedSize":9233,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqMUtxXW5k+kitmleORuRC3xMuZAZAH+fvt85f0FWlnwIhAI6HxjXafOc6jzAKszrdStAI9ZkbyPmaJDDDJZ7GuMp9"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.2.1_1522169120200_0.3517782755324421"},"_hasShrinkwrap":false},"2.3.0":{"name":"next-offline","version":"2.3.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.0-beta.2"},"devDependencies":{},"gitHead":"101d5ef8be17d9f541c72db022deba288b5c884a","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.3.0","_npmVersion":"5.8.0","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-TEV2Q5LPriXvTo1GxTKvlQzWLahATGxAlbkrtcD2viJzxCTLu50ctqvJ3XWPVSdA3Gku2qomzNj6PNxhDC7UuA==","shasum":"cd94e82911f9800045e9db145f06a8e61dc6b728","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.3.0.tgz","fileCount":6,"unpackedSize":9520,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOwkhyBZZYlXv6J8BNijPro1SJDpX2a22b1Tn7xLsW2gIgZn0145Hh6CYGjHWrD5lNyfm9DFfcc5DkhAshydJZ3P8="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.3.0_1522342225403_0.2713883034726823"},"_hasShrinkwrap":false},"2.3.1-beta.0":{"name":"next-offline","version":"2.3.1-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.1"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"101d5ef8be17d9f541c72db022deba288b5c884a","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.3.1-beta.0","_npmVersion":"5.8.0","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-Nzz4RQBUt0Y0vEvGEkCjRQhad5tj9wbuCnrLExdvtE5xyQ6RJCcy/CXXPwa+ArhjyDh0vaZEiFKBLoIYDtAcjg==","shasum":"3eb67077b1ee1ac46b13bf0a2eb56b07ca320e5a","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.3.1-beta.0.tgz","fileCount":6,"unpackedSize":9520,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhI25+KSaKFaBpp+ste0c50CBeo1mvg1WO595qI89K0QIgFhqXzOlu5GTN0rKB7eIWoN9oZgQLj5qiw0A/Thc2mlE="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.3.1-beta.0_1522342456621_0.17747991101762972"},"_hasShrinkwrap":false},"2.3.1":{"name":"next-offline","version":"2.3.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.1"},"devDependencies":{},"gitHead":"d74c30180dc1a07c76340ed8acdf1ec7d94d384c","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.3.1","_npmVersion":"5.8.0","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-tKs07SP4yIIg5UBHp00oFVARvGwHeuorPpAPWj3zfYeP58QLxGIsgbH6hgeJsfl/BOeti0StG3bbYQljX3xdZg==","shasum":"cdde323be0a8150579a84ee7d741af9367a79c72","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.3.1.tgz","fileCount":6,"unpackedSize":9513,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxeI/zAWY91+duKHTAjmTsiIyrK997SbMjOdtKTHvCxAIhAM4UX9GqCVMQkIYGt/0PgNfucbjQ+ed+B74afYqc55at"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.3.1_1522343099970_0.33312221360814154"},"_hasShrinkwrap":false},"2.4.0":{"name":"next-offline","version":"2.4.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.1"},"devDependencies":{},"gitHead":"38c5fb614ea199f009ee4cb996acc9a8f507e91c","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.4.0","_npmVersion":"5.8.0","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-JTNJlqLHoGAopEHWjlMh4gqNMeVj4Ga4vZo724MZh3NMaT7TizITIorzZCGc8PWkkDg6T24bJrToQRnw4lgGRg==","shasum":"8126d33dba09460ccb4531ef2133c86c55e67ef9","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.4.0.tgz","fileCount":6,"unpackedSize":9774,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJ16foEOKBpSeKXAF+n9MZ+Xac+kV2Ag/gQrcuxgGPLwIhAL+DLf8z2Fl1UdoIfcofXkU/3ZqXU52/vaXT8d1WwJKV"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.4.0_1522776477116_0.7663665753796798"},"_hasShrinkwrap":false},"2.5.0":{"name":"next-offline","version":"2.5.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-webpack-plugin":"~3.0.1","workbox-build":"~3.0.1"},"devDependencies":{},"gitHead":"ee8c94821ac0c38e24a8833975e63a0ffff3baac","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.5.0","_npmVersion":"5.8.0","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-EqkOAC0o8gYC7V1jtiuEKZXwrMAevNLLRqwQL+431dKb70bK04OtFxN/my5gALjNRwvKMKKUUtkktmdhIvCYNw==","shasum":"35a492a95161e759d3954c13dc83e00939a1ca15","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.5.0.tgz","fileCount":7,"unpackedSize":11279,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDoNOfB+tTHbZyVOzUg5KkJbR94wBvqlcq2Ka3/lkEEAIhAIuzLPE0kmyfgrqOTbI1QdQPDOSfzXbp4K7cPUW2H58X"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.5.0_1523319730311_0.36735850158851013"},"_hasShrinkwrap":false},"2.6.0":{"name":"next-offline","version":"2.6.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.1.0","workbox-webpack-plugin":"~3.1.0"},"devDependencies":{},"gitHead":"d89e87e384f02cf45e82177911894e19573fdd4c","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.6.0","_npmVersion":"5.8.0","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-qNFJyDdITAorGwoS8QuDN8ifeeADjK+u+MZk8XRUB/cXcv4nW+oui4sGGWbLezkLI/iW5U5N2H7vJpRoVGy7tA==","shasum":"fd27f87d51950c8c91c3b431d9d7e98eecfbca6e","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.6.0.tgz","fileCount":7,"unpackedSize":11279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa22O/CRA9TVsSAnZWagAAqtcP/0v2YMY83GbwpmudUGz+\nekbaBCUG+KXtM4PN59XeuqAH2pN0X3sNmEiwj4b+s5dAMOAGECKUI0L5b8V2\n1W8mMNYt2vd0hccj+rOKFuwOOpQLyVqdPaxi/bNVWaGu0B44T9KaJc4iJwq+\nK3IKBpfsx6bHsubyMV4CA5v8sbDi1AfiTRuYwJ6T0tafB9cKKOU+y4+X6Ph2\nu5pYbnMQnJOEhNl/DXA4qWmVzjMARYWKr/mp0eXqdBUWZlb9e3ZFt+YhkQiO\nTz/aC1Cq2E5sX823UpnRdAW+bmA5SbfETjAD8FdBqyMfHQQ16k1X676maKeH\njs9cavAMwFv4/Wc1WaQEUikNdqRzxLwGG9McrIDKHg9QrqjaxRbQQLPuQvDO\nl+xOIsx7z7SgjeBY+TbA3EpIbpyzi2iKMK+XGe4UTVJgrPV2gBP0wQmYEz4E\nemQJWA9DFAPNiHKBcBcrcc7S3/RxhGWNBjqMeOEx46GatSR56mM14A9xBdaA\nGprkjDypatmiEbnjavGVjOBak5Tp3bxuNYEM/o7Ux7uoc7W/Tyuyw5lfdy9s\n4mc5fxHlXQBTXvXhDl+hJ3QiqwisxU8CszGueLBfpsorvvJ+/7kfrD5Ooggt\nv17oXqNFATIIF+hmuKtNDczifPzrC8WJeg8aVG/aIqkeI3zZctw0IGcgTkI0\nXJJi\r\n=Cg0A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcModZG7YdeTEYhEa8VRVOsgCLa9c1nmmF99mBWHMN+gIhAKfM8vAsF+LKNqF6zw4ocJ3lMeR6C0F2CRUPLr2WiDTx"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.6.0_1524327358356_0.07913275165352385"},"_hasShrinkwrap":false},"2.6.1-0":{"name":"next-offline","version":"2.6.1-0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.1.0","workbox-webpack-plugin":"~3.1.0"},"devDependencies":{},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('/service-worker.js').then(registration => {\n      console.log('SW registered: ', registration)\n    }).catch(registrationError => {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"d89e87e384f02cf45e82177911894e19573fdd4c","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.6.1-0","_npmVersion":"5.8.0","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-Adh5mZ8T2Y2AK7g1NPmAbAIMGhB9AI2DPNHVyaz6HvG1bawPpAKVv5w+WhtAJIxdv6mejoBnVhZQ/m/BosylXw==","shasum":"c2966756833ee201c65b505a3a2beb84a864ebf6","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.6.1-0.tgz","fileCount":7,"unpackedSize":11200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3TvHCRA9TVsSAnZWagAAvaAP/jIsL8S4ixccCRG+qJwg\nyNRHmwyHnJbD9/+4sOv1+j6j+Fc9a4Zcifz23pw3z2vMkFoke0zvEPtzkVqq\nd6bodpIcJ4y0Lw9BS0ZltrEVy6VArfLaviq6JaJI1Ov11CsFJrTXl0halvoQ\nZvsurJYiIwNTdFF/PFsn4FpoIA5jKUVMuSe4C/OU9iSIu7QQqs78ah5hxJhe\nsqYkuUM5854OCSQTYBB9u0u9aBrHIFYITDn0gNM8C67YBXRD20PDYRFg5jjD\neM94nriWb3gBlZKEb5/KT9JFzRDORZvH4AkmciwTfxrNxMDOK2GpXhqvwuxS\nc/0JqgHhFs5Zgq78DF0Owq7XLCvbVP5acAKCSW/gKjaSkSd3cYKcBrklEbgU\nH4v9RcS5gEJc+uSpD8AKtNMtnynlSq3lql3WSK0x1HdYh9YxvT9q/CGQcKUH\nHsCO1j6Ox2ssLAHSgJ/5xmkuTOdQhMb3Qco+TD/BH8TlMsjD2ZGbMOd79KlH\nj6upGYQ84aP5RlNdeNPrKyB2DwAh8P5ebajdaldQEpjiWWFNu0aq7PvFGDfD\nph3q03xYZozn+KqdE8FiCuVeK3vtjxBTH5RX1ulqVN4D+zkn9P45rtly+z3F\nOS/Pjguf27vkVhJp9hAfPGLERgvnXbq/mL4FAZuXM4+HAryYOxh3Oj21zjSB\nZpmx\r\n=sV40\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICoYvckk7r53cmcU4xT/peVFi6cV8KfBZWa9/zBRoIK9AiEAuOXIB7+sZ/pSOBrMUzJnWJ4ZxSrFhaayKT1X5OkLGts="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.6.1-0_1524448198545_0.9368910812098821"},"_hasShrinkwrap":false},"2.7.0":{"name":"next-offline","version":"2.7.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"aa08b9967577a4ecf9782742d87d6399fe8c7ed7","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.7.0","_npmVersion":"6.0.0","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-l9nDFb+U6bd/9CO1QqZWsb4BKACBkodtNaYSmFa3Iw/MeldSi7Uj6tyFjm7WlOkRxrDYDFrpo/QwT+R91kyOGQ==","shasum":"5a221523956393ffd067495eb4be96fad89d8f4d","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.7.0.tgz","fileCount":7,"unpackedSize":11279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa83mHCRA9TVsSAnZWagAAzjkP/AxhXBClqG+fb0zg+suX\nZCRNXD6TVx/mKQTc1mdvRueTyicsMy/YqybS5kDL0dnZPe/v1jBUZsz5kufu\nkvt4LVoClCL74+g/Yuk/vQ4NOi5unmNH1scR1/aKeIW1/Kz+JQK1ySqDPfpK\nL7DOX+i7OEt2JxRvx8CABmdf+FNP2Sqtj59VkJXF01/Ik1YnI1MFkjayVSek\nNhmKGhzxZAiPmLjzURcrAzziKqWrbNlJjL4ceIgtpde6rl+i6tuZzJ9O1Rtb\nhEisRPh78GTJ75cpRlgNCzs3oI2lhSthZOUoYiCbNpjllatlZfBWkYwUw8Im\n0t3qmZRaBu6OTCwHoV3H/OngkGPp2RM2h2B4SpGfg2QgnU23zvnMilaEPALu\nXwDRuFrgI/nMxdtXlKw75EMDEHpdaZrcAp/0aNqTJJH3diJcX4xLrHljh2C6\n/BojJki5zxEkYcojNSmlns2QiOFdwtkzEbW566FgCdTjkZPV2cHPVkrck3vn\n7uV4PB2gmT40VgnuXez3Pq9YEl/wOuTqLMXSChxT4RbIm6hJqU//BtlybZBV\nX5RlmpwMEEXnfFM0D+9WpzoEcbdzFeMMtKvUQhX+N1X4REgCGEcGWuu9s0Jj\n2Bd8l772uF6j4B516t87TnIBLjETycF67NseJEifqRLzf1qbRoe/i1xKY6n7\ng6fl\r\n=tazS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxaC/e4fKUv7hIXde3Q4HTPYfDgqZ7qmLGRRAgP2yAwAiEAgGSWKOW+hGRXmMNeviRp/GhJorSR4oFtgISKAmsmE+4="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.7.0_1525905798014_0.6768035110996939"},"_hasShrinkwrap":false},"2.7.1":{"name":"next-offline","version":"2.7.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"46ae12f65464f0115c28a3520271677200822e1b","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.7.1","_npmVersion":"6.0.1","_nodeVersion":"9.3.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-8GAitkzLCWPqHBVF9YrhlOm5f/vIiz9MjCnqMTCMv5CEXw8rnMNNPTShr21wYTaL2mZnBbZBwXXy6zXgZmDX+A==","shasum":"7c592ca94598b50baa06445e716bed30ab42f036","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.7.1.tgz","fileCount":7,"unpackedSize":11301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBvA4CRA9TVsSAnZWagAAiNsP/iBX8xo9DuvbhKN+p3+X\n9xhBej+XSDKEjUYeNT3YTZwkxvp77JyaZFjZ7TM/7JvMRXRu8UNurNf6HqAf\nwLuSFP6ecxm0/smodRj/yuuysGQYPqOE4p4RTHT0CEcCxryy4aJ1444U8DvT\nBpdjAobjVSV32SsPJRl7AhoRLDp8BxSuBiLimW79RSlBDmeJRpQn4QWYrwWt\nEKfjD292KK+CgXqi/UFJWL+HCTXoBYULtbVlQRXQWPwdPkRpEGajns17F3bE\ntDageoNEz/w0zDAhsVOeSrw103YGOLLMDTgOTGMAZBleH5SLv6zjZQXNYBQ8\nz1dpDJxJqhfdKF3PbTwZylB+SDBxvDOfMzOvMq2NlxqXojrhVLFZcv0Ow+hJ\n3aUsAUYkawRH3gPy0Uh0HOfSS9oTxWO7HG+YUxXsPoJWnatU6sveVGOUIfRQ\nJAVGMmJZnRqTDQF3aQ91pPO14B2zoYX57WpjNDLU8nAuhK6ikrdyd6siNU+c\nidTDGsjohNQsaIgjlmc381levKYhOBpGA77VHwYJrGW17OO/pWe949U/6Asy\nbewxr+vvVLhkEur7Q711bOnfTmxNwslQ4u8qH4YFbelHQlBGs97uwLcnq/lU\nUi/RiAO0c9hiQY7GnOXK4wNHN8MYWWuiyNjBE82uiW90AznGVYS4pp7+pkhY\nwuAv\r\n=FyoW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIExvMSXqNDubjWxVd8iPpZuCAqZWw5UqeJfn9wjHEMhsAiEAsEOTSiRNKdo00Rboe4g3aeeFn4xTxxvPwxjm3u4UXrQ="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.7.1_1527181368117_0.3242397503185528"},"_hasShrinkwrap":false},"2.7.2":{"name":"next-offline","version":"2.7.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"4dc9cf32ab987844eeaedf9254abc727d80c3151","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.7.2","_npmVersion":"6.1.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-IonYdOL9U32nRoTSuCBW8uLwtN0IGkbTd8DvpvkUtHTttk44o7hoGxygyfEC/YyEYvS8nDSYBln3B3Yv3OhQLA==","shasum":"6c3b520a4662d4e88a806357f6f6ea06609bc711","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.7.2.tgz","fileCount":7,"unpackedSize":11506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHXZ4CRA9TVsSAnZWagAABekP/j4nknrVjOOWzy2gsh1G\niaJ40rcK3WhBl7csxoVR7eUTSYfa9NP1H1nVWC4vJPybOFx617tn/5kDkGev\ny5IVJKFi6y4EPt0FGV0EFP3kk6PgKASXu74TNCt5P3Lf9MxiBOHDUAVLJL1E\nkaNhLqxL3tL5WpjTJNlLw6gk9tQLF3d99hRqbJMGuiawdv2leAyEY+iRuimH\nsAtlHy7NlU01Qq8fc0U3slPk6/qfdj2BnpWeYfnMRtt9iDUVoOzi1pRcvTov\nk1BL9zc20eMUxV44UHZqpPfUikflJ7/uPvq2Zo5/o16HZhfK/+V9W3Jf59iF\nmwj+p6NP71K57EinjIQHov+fDWAA8zSzE4NJ2Xoz5FolA5444uNmI8FcFgCB\nQ544XEkLABOgOtbU0pCY4Y3qg95rGDjj6Kj4lOtX+A3CF5LRm8AQHUNcE+Os\nnkfWfKQIU2dQcu8Lms07esf1OK1c2RU80zRsm9Bmzj+P0Uw0HZb2bQu7gIQi\n41IOLVGTGgSys/eiHVB2eNisuw3iEI7sIpqH+3RoN7D/5RsedRT8x1m+dats\nRQ2vH6O6zC3GWaRJ13MB0+Tep+VCaDyZ8BmG/c7GOtZHEEDqiTIhBZhPT/kz\nvHMa8LbbQyfAxQtZd0lmdFzqyS1Tof3CS+ExwJtv3WEJ1OiPYMwvPuuG0aGu\no+SS\r\n=2DIE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSvf5YhAbGMHTe4HYXdOdm2kMz0UnAVqhyUYM+ci3huAIgb7hz45Kr2xnuE2UnECn/VU1TtO5EeI+mHOxFKzmLdeQ="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.7.2_1528657527597_0.06621831966541158"},"_hasShrinkwrap":false},"2.7.3":{"name":"next-offline","version":"2.7.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"aeb85fd3a8078238f7e3b18c5dbffb8849bfeed5","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.7.3","_npmVersion":"5.5.1","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-Eduke1+RJyKixQVvb0kXgQjopPLEbXlB74ClW20XePYlNM6m4tqM4mruSo2Fch62QOZJabV1F+EyRGYQupRXrw==","shasum":"2f928fce2daa027b52f3b563882d291465e60264","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.7.3.tgz","fileCount":7,"unpackedSize":11516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbQrOkCRA9TVsSAnZWagAAzqMP/04FIasRYBcux5h/YSxA\nrZejtJv7o3UR41hX/r04RJ+mc4unPQPvrp7Xk4PlrNzAJ6KCQ2sBe5nHw5Te\nUEP2klQTEeVncW8+5lZxt44MMM69R3n4mbbeOo28A5/CNtBC5HxJXjIXbsQt\ntsfw5EjNr6bKLy0JD0QQRRIW9sxE2jUnF3R6vemndX3Ls+ahX+cp6hUTrGJW\nrtzpa28wcC0NY90P4zf/1k0L78k8o7YuRtVTTgy9at31zNGNviDr/yWbyTcD\nT+4hHcBaWMRpVULtb3OviN2M9Cj3U7vb0+TkLBi52lAsJPfCXox6m8N9a7uA\nVdM059aF4EvHQtm+pQdcbd5nhtiZbObBrTPfu8/kT/dRskRvx1xmSgKwCwgd\nmJAK6i79Qyj48724uKfBMd+q6K+FF7QmNyycritDO8kSQ+CF172yPpdIsVkr\n4stY5+rcO717CG24KrFp0uALrVVYnFD5Q3E4APJapUDMsOT/2WpDjcnE/kjM\nXKMSrEGin/t9Pej/mH1UAS7qQmjuhX8yxXsYEistxXkBRX299I97xNvzhG/8\nRMULYSbl6AnccjXPFhG87QdOIl7kECce0hYGk5HvCPu2SSEuys6qPoU+qOnH\nW2Xcgnu5dqvvawol3+CgK/DYFJ00jTX3NAaeqbEs4Lsu5WPV85opHtdTK4JB\nY+i3\r\n=hmGW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBgH1eY6d/rG6kaGY8q/9PeDn8hX3jOsfZzn5Z0wAXzeAiEAhxeTrQMqDwWX/pawO3ImMU5PK/lD4jlET5aYDP628ec="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.7.3_1531098020015_0.5884857220364894"},"_hasShrinkwrap":false},"2.8.0":{"name":"next-offline","version":"2.8.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0","react":"^16.2.0"},"dependencies":{"fs-extra":"~5.0.0","minimist":"1.2.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"c84027f3d37828c0787a1623fab8f0399574678d","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.8.0","_npmVersion":"6.1.0","_nodeVersion":"9.0.0","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-vJvoFJAVzBlRSzKiDfGanv55cxRLDG5jQBzN04RkfpAemRDs+xT2ImjZ8o5ftteViPMORigluplIOr0UBmsqpA==","shasum":"76df4aef2011e77da05540272ca36ab3f538fa4c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.8.0.tgz","fileCount":7,"unpackedSize":11887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbTUq4CRA9TVsSAnZWagAADlwP/02niRLgJDxby0K/ZeUj\nRI7pEUWGhXOU6UZHat75NN6S8kenT02PziJgBXAZxtp1oS8HsjGqm3NNg99E\nbMnSEMVp12hMenNWeMRXM5GhvKxrRuhR6JU9LA/eyzk+Rv9qdTX+OrocoHa9\nIInbKY8HtRbNucmPdmT1kT/n9+qgZ7j4yApEKiGCTV2TSXkZyIPht1OvOEXD\nnyz6ieKerbNrgXIiP6ECP3L/rD7e1phfSOD3ZaZqxCFJEgNPz8sEbL9GfOzF\nEV8Bh7D4WMs0XJL56x/8ZWmPNFFHVCNBq4pFfaMdnVLzbZSF6O1vAOVwkf3/\nyv8fDDtO2/pIrOE1/heqS4/W6cfhW/VwAJS6IkisBUEJIvTMUT8lJlaWjlpa\n6oD7pzAruTgS9uoc9EKHWzfyF5qEHCgslKXFN8rH55IzbU6oyqi3q1PZZzzQ\ngOPtAw1ecEd8ZYIzaaZEAyTIB5qelhXTOMgUMuiNuiTLd5/nnuduut9S6Itp\nvLQ2TXTzzVF9q/QjMmbSgGe1Y3rdJ/80inW2BbzSSx4uMS1tIIQxyA5B6DpY\nz3CpdmG5AotglVm28xBZqe1LuSh+oISQ9vDBm3RTKrR1GQU/4yCA0JZyxAaa\nvtscBqvP7WXAdtsUuG4QtXx2VSFKybUWdC/nV1IoF3O43jlkAobfsRctvVaf\nVltm\r\n=TOIv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFuhWhqF1RY6U6IUzrnH5q+NNfUJkuegNAMx2e4QritGAiEA7MfxgGD+rrN5TORvrseGRwgetDGW9FEFU6i0gDJ6ERQ="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.8.0_1531792047298_0.49620937627150474"},"_hasShrinkwrap":false},"2.9.0":{"name":"next-offline","version":"2.9.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0"},"dependencies":{"fs-extra":"~5.0.0","glob":"~7.0.0","minimist":"1.2.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"448d80841331b449a483ecd5c5be3e820717b391","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.9.0","_npmVersion":"5.6.0","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-P5UC+NajxUBn8ZwiE4NtV2ebU2FinO0b6AEnqAA/KB6fCRSt9v9RM61cNwMcgN79b+0cB7UQQ2/AkGmrlt5/+Q==","shasum":"53c3af19dc4b502a02f7b534f951cc8e98c2ae97","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.9.0.tgz","fileCount":7,"unpackedSize":11850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYfiFCRA9TVsSAnZWagAACQoP/0JshHkZu+688DszWZlr\n7wWg10eD0wanSXxNDAz77cZOzW1ecthAbOP+eWkb1jhCKwFfVShp6TDzIcBv\nBPM5IQMqSpR57Pb7CygA8Il6C6Wy3NOw9y2xe3DiCxk6pWvKTZYXX5i7UKc4\nWnAOzBKbjEsItwzNMCwUWvNMNB4C6MaZd3vqtVaqiGjx0/mmVexbAktdxzlP\nnmVMB7sybvDlg0leRIn3Grbxvr9JTy0oyAUNhSaNy9SjehS1e/5JmXTv7go0\ne5KELoZfxRhjZTYGYO+daBxmzR/yJZsmwtCaJMNxovWv7RlhdBJi+6WKewAN\nOfewDnS1AAOxI+xvAwrqXcjL7V1sIgWNHPkvfISqEUZe3GD0VGnZdexHDTHn\n5VH2k/BqVCKj0I/Choq5dbdvOS1iFHMTHapqWEnj0vho04PSrpsHqcoVFfK9\nnIdvANm8ORPC9AAdK98WxjTPiQHxW9XDqNT0HMrs3aj2daTnRzx9GR8cS8XM\nh6Tb3sZrh67qWgGojzUO2Z/LrFboWJNh0fSJU8dKhOabraYxcFLOimVCFZuU\n2dcIoIy5vnqN46us09IDpxsvyfjkiAzTayhlTpxmU8wD4Ic2dE2XCMVhIZg0\nODDctShsGLdUUooWOwb8DzVmigrqgDQaWn+vol3BP7qe0rdI8g8EMZlZyWqa\n4fwH\r\n=4lWT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDA7sbv9hXq/LTkJLZ+VsNM9A/7KPwJQEmmZXzKNbon6QIhAL1E4k1eKmjXSdS0ESttiKmZ8PCjsr7xpuSMxMq9gqdm"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.9.0_1533147268164_0.5530330502346716"},"_hasShrinkwrap":false},"2.10.0":{"name":"next-offline","version":"2.10.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~5.0.0","glob":"~7.0.0","minimist":"1.2.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"d58e7fda4dff05805319b73d3634360939a20b08","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.10.0","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-MRkvSVx7GTomezoLMxZUXXXP8weoVwzjU72TAZ5jza6U166kALI+CcUt6z5g/+uG+ND66RjyvWDZ9xDxt+54PQ==","shasum":"d272b5f6eaeb83622cb96b329582aeb039a9adf0","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.10.0.tgz","fileCount":8,"unpackedSize":13236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfzP2CRA9TVsSAnZWagAAPWwP/jKCYTsYbsoQmdCq1R8C\nH2+kShHJEAFvEb3jrG7qWGxVBksOwNPmjGCmWqEyGuaphUt1IBTB7IntG8bW\n4yL9BlAA1xdShnXLcHLJlezY0Fv1AhZv1uHE0UFBA2AL9gbGk0aBI1cPJzSN\n07MkHZK6w3U53Rem7GbCE0NTlV0Ojqc5g47fOoefyPQhhdH/iMKAxw8KMXDc\nk4h9zNDptD4rd9hI6iaBMK7v24ZISOdl5rFAMrz+er9Hh7NqRc4sN3mx5kWP\nsJYWJA1rYOlOic/FNrkY0aX80XA9I6yGeGeKGnO27d7/Jxb1pHEBP2bBW4ee\nGluGtEhmETwM7ANtJQLreSuuiWAfpQ9r1eETxuXdyG32ioLCsAWqHXc/5sLq\n84JWzC7ouwjd8rL2/GFH3ng8rUdnwBBOw1r89ofNXe/tOHISTx/yd1Ws2hoR\nX0UnxF5i8PkBdUB8L1i9L6kgdIAyEP13qDRCypaoskNUgS9KQlRHx1t4cnwL\n0K+7uAVf5kv7nHm3YLzIJYj3pUai/nCB8g8y9TP2s02rCNm6vKw4QdOpOY6P\n+neMxJVgGiZgeD2BYJAD/o0OBncHwKSX12UNdg5+26nRgVi4fgmhi+dLSl4n\nC++ypxjuJdYzzjhW0lUht0Te5ZGZbyXQiLoi0BaY/5dUY4HwnZqx70pXOW+K\neVW8\r\n=Ujme\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFC/EB5Md841vKo0XjSqu6lIgPV39rEmBJ7/x89TV5l6AiAuEkQ0I7ZFAnlNQnMFCR974Fiz/5WQw79D7cVEcnuQhw=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.10.0_1535063029551_0.4746805332093451"},"_hasShrinkwrap":false},"2.10.1":{"name":"next-offline","version":"2.10.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~5.0.0","glob":"~7.0.0","minimist":"1.2.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"ac070306eb57f4af11c9be948199870feacf4ccc","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.10.1","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-D2EllKToLQfPF61WhNNSO5hcHdBoXXxAbw+lAkSuucNyL3p0kxpGBz0UfGwm9GbAo/C+BNVgsvRF9MvQsxZ43Q==","shasum":"561bafd8657a48cda8f65fcb9fa771154f98e95c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.10.1.tgz","fileCount":8,"unpackedSize":13260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfzhMCRA9TVsSAnZWagAA1wkP/3mDenjp5i346Lsw4Ege\n6v8fJ2piIUUnRGushMHzHm7WZySgUaSxH2zbrvx61zSM+x25T54GV+ruOFwu\nRxlJvd2gExPBW+/C7AJvL3Pw3I6O1swVMYOyLMpAj6+PNder6vAdEt+S1svJ\nj0aIzikevDW/X8u5UIsK8gdew2m85yWdzL5FJ6PgEBezSsJtRH2ngL8Usunz\nYkySwPLHyOhyK6qdR3ZHkt5wQMzfuRYMy9OZxPdTl0RZaCz3GpxeVM37ho8J\nQ5PWI2YGAN3JgfNqarritO7bzwxAcwpsvtmu7AllGbcUij8bWKPqbbhg9a9+\n2bIgsFsTgpcZlQJFRo8D55BJYjGA0GOOy+uWMlhSDQxMj/c4azXsLGh91kzc\nEqk8YqELc7TUd3KIQkD3wGZEif0F0s8xZt/jT0ttPSTjm3u1zuRiay33QCe+\n16fyq2plhd9vOA9hW8LQPIoX/N40ytnPYnSgcIEps5Kf6TjBLIut5KPmBYvY\n/sjIZWlCoVk+euIobTAwLRuGVSqnIUeNfmD5TJ6dGtOsVfb1lH3736HJuGlY\npHviNfYd95GsrwkWiObbE7pSmT+8i+mqmIQ02u+Z4WYneRfFILxrQmJFurgt\npRfhOT3xWiVtQvC4HjxkaBbiDZrpUN1hh8zv9XubhdgUxRc4nkUvsJGdYEBT\nC8FZ\r\n=JSxE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUrKSOTPVVa4fgHwFF7q/eMjA2FuF52GyM4Zt9jbQB1wIhAK2jAqp+UAKiE9XhSKIuzf1b6IiHmBAHr5bKE9+MwNf0"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.10.1_1535064140012_0.7993270800840957"},"_hasShrinkwrap":false},"2.11.0":{"name":"next-offline","version":"2.11.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~5.0.0","glob":"~7.0.0","minimist":"1.2.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"e81397fbaaea502e1c3b22ca166fe390a6811d11","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.11.0","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-6/kNfR4juBVBGSBxSibehXMDxXKChtyw3xKtTsrcpP6IhrE3LR4RGrOjS72TFJNbZoCNOn2WzFAhMmMp4VuSqA==","shasum":"9c24eee1d0e0f031174d4cad2ae577fab9c5aee8","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.11.0.tgz","fileCount":8,"unpackedSize":13010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbgCz9CRA9TVsSAnZWagAAHnoP/0mStM1R8bTe0GIthCpz\ni+S0wHSUUTH180DB0FP/qvVTODPyDEL5okeqsfSzAuLBb9Qol2hDaOuajwIg\n1NPhZd/b9G+ibiYIjFNn4ppUYHCCVqXmPl36jHznTbnuui1/iH9BqCPMHtBe\nD2tGMAvGhlGpAT4GVBf2rQ+VLWW9GidysNelxYg7E5WMEDveFALHoRrnthkp\n9aUYgueRwsPwyyjpldkT10uihZNWItGtRQpGVNZWaw24eYupElT3mT/Zf1US\nVe3LC6tg/F7fkUFMnBiTJGobBc26Y4XZrxgaZ+Ep9R1FRxQSXAJQ33xrymDo\nA6C2ZGncarAx3+TNDXjLLdluQWD/e5ZVdFYoBnwjwirvYOzH4qIGgWwQYsLs\n/Erdho0pDsjJdm3DxMaG2zfoCReupcNN/H7cRPXtZpMixQ9rhxFpkcTZuN1/\nX44qb4znw5zWljmMsp+4Q7OUmUESiy4hYUpWYh7bF1SMv4740lNYxUX1tesh\ntBwCdOr4HyiLG6yoItQmsSSowdHfwtIwhUrFoDTJwmY74aEIlzzFGE70JWlt\nIXkQYU9cjE6GCqa5g4cjIwvye+718ssK4ocS12rzNjBulpFNqp5OABmveZMQ\ncFiJlmryYSyviGbNHE++m1Wh1+XN1YElyyPiBV2isNSaIR0IRzQijtGzc7bI\nmw57\r\n=9b2j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEv9Fe7Vx+ckUZ8ryN6DjecgTJSERfOwawsBXAuPGRiAAiBgLes8pqLJV0SDOI/Ek9upJx9KUOCkNbAjlD7Dzs2GbQ=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.11.0_1535126781234_0.03609757343395281"},"_hasShrinkwrap":false},"2.12.0":{"name":"next-offline","version":"2.12.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~5.0.0","glob":"~7.0.0","minimist":"1.2.0","webpack":"~3.11.0","workbox-build":"~3.2.0","workbox-webpack-plugin":"~3.2.0"},"devDependencies":{},"gitHead":"acc4f35ed18ddb55b4573315b469761696310663","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.12.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-frHXBNsuTQ50gOqdyfztiyNJSHg2mZDkguxF9wxMSCRDAN6nWol9OPTDSxwPEOrqWTIMQgIgzxKBKwguNTb+jg==","shasum":"6b932acc691e17f15206e5665b781c1073a19ebc","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.12.0.tgz","fileCount":8,"unpackedSize":13165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjcYKCRA9TVsSAnZWagAArLUP/2Zld1MmBhJW4mn8iEot\nni52+FyQd8DNJHqyMJdY1rE4zcQFLF2Y16faAh49/679hRMArYEDOb0RueB7\nqgK5M11aWqM6VJMEmU7ipjK0oPXrX5gXCY82DMDBVzaVcqL2KJ/wD7ozhzX8\nd3LWXDpV2bQUEhzqzv28kYL1K8MrU/mEZEFw7uh65gJwydrSqNJYIuwgBtrT\nJ9TWPdZwIxwSkmcvyuhCZBsYUWSju8GUeG+iX8yynPcfhyteys3aC096PbfP\nI46ReuF5ROp8kANonoJWVb/1MoelPJdoyLQGGVG+0rqwRhThKBOFT1vCCOus\n4WnsR5bp4MGhGecpkPoYCe3RdfKxF7UVd/QNy3ueLYYHHPfEiP4wl3x/Djlf\nkW3qJAHEVc8FqNbQ25ltZB9F5rm/dim/0yprl9Ox5KNIPH4+BgF3Ame2L+2h\nBBH++TWAy3/cPGO/BJXUrdSQvpCPCh210PGIsfI4nQZsg5HOJ8+koMzAVgJA\n4ob4pDDSXp8Lx6OfmDqOoVlB8tGc3VkYZKRCqT0S0Ir9z7NrQPVr1TXd9OTU\nYCPCovSR0MgA9fSw6C136Jv799lkKDUYYz8lPBzQag/WUfA0whrajIegh4+w\nJzZpcBFZ+ATS92SbyJ//6Ga+f6JHP1b93lV7OyRSn7tM11OOT7sVA1RCEJJC\nGiVx\r\n=OIjR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEdtyBSH/16EslaKUK3A1d3vFPIWnVNNr0OxhW7cRIzgAiEAnKx6dCxTHPJMXM2Ze8yoFc/y1C/kaaT6R0bMS/jkKe0="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.12.0_1536017929546_0.6115452876481609"},"_hasShrinkwrap":false},"2.13.0":{"name":"next-offline","version":"2.13.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~5.0.0","glob":"~7.0.0","minimist":"1.2.0","webpack":"~3.11.0","workbox-build":"^3.5.0","workbox-webpack-plugin":"^3.5.0"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.2","pretty-quick":"^1.6.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"c7fb52dd22cc2b6239ae885aa629142127a0875c","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.13.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-mohzNLohlswzIzTAHUo13JjoTz1Lut2CO7/ghPBeRi8elo8/MUyYvN88Qk6uueYSsNiqImg9p7nf62h9wzp8zw==","shasum":"12a4d02b19acde6c2cbddd89b7012aeb07d202ea","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.13.0.tgz","fileCount":9,"unpackedSize":109134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbn+SuCRA9TVsSAnZWagAAih4P/1ay6kTBcqR42ge4IhcL\n6lVdXGcl0JOqDH4aBgn4qxoXYNV+HugDbPvjUZBrD3UndKG3Ncru0w8Q1cxW\nb1MI2Iox36Shu6akZF30mOTcmhsbVSB2l/kLbgEDJGINedRvwIwtgOLy7p6C\ntIDGJEFhGSOzHCH6pc5eeBzp3Vg3jJOA75vmMW22Ky8/O6q5kP1dfKEidvmM\ntf7+N2rW22Fz6q3daLELFsNcIKOOOePLJNzJvXZFPa7HAuaXjOy1WxZpZ4pq\ng2RRRnHZcz9a6FvowVMZmj3bN1V/OqCoc4yc18zyYJJ2J0JkxcfcDl39f8CC\nRpsSjZ8N5oQAqqEcXwp/sl9PUboST0YOGhHptsK5oiN6dJcbOMxh9RBvep/t\nXMvrp5uSCLZeeFHRY3BAxB+YllhufQ6xnfMNIY0iVvRQdCKKFXrI4ZKxbWSr\nvhNApWSotln5OGEcV1d+/N9J7Z60m+jcxXHj//yIakgLYFPM6uDt+A8QgOhr\nvXGCNsatWc5bQBiZOdeC8cM/C+Fa9C0Vt+u/uRNHtULa0R5iFo1uli5wIP6b\n6+hmIzt7Hfb7qTZ8RLPKJ10tJKY7akTN++qLtNScg0Nd4QnqSYigz0C44dZP\n9fSmXU2SmOISy4fJjFhhjFDoMSJBL+9k2wlGLoFSIlM6Wk8rA6CLDqba5g2b\nnYoy\r\n=332W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvfwpw0DS1kVGQYgIp0NWoECDsbvspFNff3p7jDy/EDwIhAI8mMHp0FjiAdj85PN1KCUdmjBmil9VBGv3jzdG59h8P"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.13.0_1537205422058_0.44291802973959427"},"_hasShrinkwrap":false},"2.13.1":{"name":"next-offline","version":"2.13.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0 || ^7.0.0"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~5.0.0","glob":"~7.0.0","minimist":"1.2.0","webpack":"~3.11.0","workbox-build":"^3.5.0","workbox-webpack-plugin":"^3.5.0"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.2","pretty-quick":"^1.6.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"f90369d7bbf4d50555de5e9cfe19f2d78b2264cd","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.13.1","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-QC1oY8jwgm7TUYajLGag2iv0QVBAVE+QTyOyCgjfKjHwyhdcgEtEXxY2Xbcx13uuMnNnRlSQ2DB5rwlJ5t2Z/g==","shasum":"0f90d26c12aa4553d63601f8055dace682ac687a","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.13.1.tgz","fileCount":9,"unpackedSize":109144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbo9EECRA9TVsSAnZWagAAQ3kP/1ltEQNrng7h5EE+T9aV\nFSfcx8B0DjOkgyQWp0+djgkT/4U7I9R//AGHwxcRq0zL8Ze+EjAm/X3F3ZFd\nGZSheBwCvnQWbvgA9UeXnxhv8D4Nuq+zDkNWQGjfyu//t4eqtA786luAL5YE\n7HHJrxFVHRiHngsd5hSIUNsp/rQEOJ1TYVVZIL4kRfo0mf6YE3HTATiFfUXQ\noR9oJtqL2qru/p+wIfQ9E3l6BUYHAujdJQtwvupANazOP5s6VERYk6Y/YGRc\n+NqkdK9kKUCWsdOZTsHIRnmxXSFU5ZsdzgAyJQpKWEYhaa+dJiX31JyJMyVM\nKr6noj8c5j+YU78qfLRERFbxMwbQuVuSwvnnnFWGHdizQCgFBW4EMwtQzrCT\n+P2pRx15FQq1ddWATPcUGqkdA+2AT4IQvEAaGKmCf316jeswMtbbF4K+3L3C\nb5aX7aDNbngX0mVlE5FiDj+aYQvB4U1Kep21PaS+YudiDEjQyxXH0sEew7Tm\nZxt9qJGgStwEvjdnEjwhNcTM7G5O3gxwEXS7WHwcHACS03vhZrZ9yY/99v8k\n7styANZjv+Lvx7PITf9yJs9nHdI7nce8uYNJGO7aZh9T082LhxByJTq2VMz/\nk3/Obw3P7VG4J38iaCbwjwJg+6KnjaAtlZNPPrdWRNrSp+nfA1MeCRo33pOY\nODYR\r\n=h9e1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBgqENyzyuIxxMl1EiLta4xndU2tUfUJV+yi6ptv5kVLAiEAkyychLAEpwfPOGBCRtIPgBrEGpXmjZx4CxuOSkA4YKk="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.13.1_1537462531475_0.3784033167587568"},"_hasShrinkwrap":false},"3.0.0-rc.0":{"name":"next-offline","version":"3.0.0-rc.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^3.6.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"# next-offline\n\nUse [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next()\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\nIf you're using `next export` you'll need to specify an [exportPathMap function](https://github.com/zeit/next.js#static-html-export)\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"b874d84cec15079ae8f04f9804345b56a7d3ea75","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.0-rc.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-tvgmtlarBk3MWpfBT/7o2kqXaSSm3+MQ+l9KD0n3c/i5+YncxJcvVAhe+G3RT6AX3X6/OMbxpHfg7kgrjq3W8g==","shasum":"ae63ced40558e8a6960f6f185761731f75e9a52c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.0-rc.0.tgz","fileCount":10,"unpackedSize":102785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpVJvCRA9TVsSAnZWagAA/boQAJHupcayU78FsAg+Hnvs\ng4xnpEmDUlyIJBJui8MWUjvCd3hQe97VVWypxSynub/MBnSHzIyQKotckMRz\nZ9QianmQMQ3TNi8y44nLrI3xaSRIH1wymz6++4dmOP3Ysv2K0gZOVWyTXniZ\nHJerU80VXdD2kYMNuU6hPJkZYmA7ZNc7x+46NhsKquwf+JuAhmHRZ9LutpJA\nczpsr9cmErtYB1/x0vzb7m8JCYYXhgJcwcUfTzTKavaTtlK8hBcTLDwRYiYO\ncOXjs4EYtcN/wnktMsTqIiD/85KzlGfLfZeNK8e4SsXH2SjKHdzlYIMm7BCr\nW8CsJvvNgIwP7WuP+qX+cPu3GhH+Y/GXIqClq43AW8M/ZKIIKYjZBd+DOSu7\nQ3auTtX+OCCKN0WEg0hRqF/UdaOuh+ecR3xAR9aVflaeDk5D74qUhqgkq4tQ\nIy/0EqSFcnUikATukWztqz+WOeqeDrLsNdTuuSNBxNx8Y7XWSa5nl8KWzJ2V\nbViraI+nF0nfmDRuKrbms57zJ+IScXtbu2HEbm9Gn+vPVO53o9Eu/U6cCeO2\nVbGCRm9JwLNV+MOSYN6XORaKMfwEk9vu81fYvF55t4bJ7hnhaxOOMNrAVQ1W\nmIWC1QdiE+bytK5ibEO0E65i+qwI8GupNJzmKgcvkfqHzCRMNQ7GwrDboK4v\nYt8j\r\n=98lW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLOChixN7pbfAEhTLLpvIpEftLP68rul/3LmN0WfX3eQIhAPn5G6R2UMN0kKKtNR01vt+a4Gx9gracWqNDg7+pvAJ5"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.0-rc.0_1537561199070_0.7523284873057365"},"_hasShrinkwrap":false},"3.0.0":{"name":"next-offline","version":"3.0.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^3.6.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"1d7784a79b817e38f51bde252e94e2479036e71e","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-mBUshBeuV7LfT53A5oOAMWYz1OdwYaRwTwDybDOAibMRgjTLw3a+9GUC1sKftdNnC6c3wm5cdqG2MdfTam2ozA==","shasum":"16096486a067181f334bbfdfabc4e21838cba8ae","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.0.tgz","fileCount":10,"unpackedSize":102959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpVSQCRA9TVsSAnZWagAA0AUP/0kC+dxe6sNhUGGluDte\ngWZUbh5ssuYST1u2kHdT9yXuzlQyO8+Tb0EBK0Bo20vxe1Ty4MFg+Al1ES0S\n1MR+mdzmfz9Wb9JRyJW4bD4eIMMs0otcX4HfFXh77H4j6FQEJBaW2NXXOFDg\nwV8D3UuqL/UYi7J2J3o8fldT7nFlF5Pt2hCLnxkXTx2LCZXObFDpjAZaTIy7\nm8WA7aEdzo1yocRW1fUQp0G6SBMzRuutKM1JI+jO+z0fD1WcYr428U7SMOTN\nrZwFMaHVGlgATrFZmnRmWX26ZQY9w3hE/bW+Hm4ZWrvdF8jINo9FCHWULx2I\npSgZUWYTJxEVI4m/+q2ULQJtL0aFcRO01H156I1ylgrTgmKmX7LAS7XRY2As\n+wZGF5uWAYkPMTwAlvfJJgO7pld6Ai9e4OvaM5EUDOwNjR7P+rK/AkQQo3Sj\n0NiEKwpnOqQZKSqHdj+ZRRdMdQnzBWzNfTDhdRCq6P6eWScWIvXUNWuJ4iSi\nB1CLUBfbrT/vdHueYktaoUjEtqOyamKtp1fbex3+RCAlbkA7G+UkyF8+H1P+\nnpJvMq1LsILOfAMVe/Lvy1hUdAWxlEiWtXzgFDYeKsSY7cM6biTiZwgD3Awc\nuyEDz3IGU+8rIlQ+AymRpNhkA8I6hy+Xd49ATEFx9L+48XoRRjyT6Uxgl8xP\nzn2j\r\n=BLKh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPTDCrIj07P0IRN3Sbg8TunYWMiRI4qv8eM3fKQ3u60wIgFVFiCgzAAfo5RCeLCkHxCsqa8Hsr4fCKsHM7+FpJX3o="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.0_1537561743946_0.21649506511581862"},"_hasShrinkwrap":false},"2.13.2":{"name":"next-offline","version":"2.13.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":"^5.0.0 || ^6.0.0 || ^7.0.0"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~5.0.0","glob":"~7.0.0","minimist":"1.2.0","webpack":"~3.11.0","workbox-build":"^3.6.1","workbox-webpack-plugin":"^3.6.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.2","pretty-quick":"^1.6.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"a14657eea2b5e385e4eb3cbfb557588ffa95e26a","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@2.13.2","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-EGz1OB09nAWEOG6rdcW7VdrwtLf/hdDXtwP54MBh0woneWK5tLgj6P9ogrNK8eyw/YfsLa7740TC1Bp45m5UVQ==","shasum":"0d0b5513403b99b3bd3dc4f309dc2ccd80155f59","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-2.13.2.tgz","fileCount":9,"unpackedSize":109144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqRJ+CRA9TVsSAnZWagAAzEkQAIwu9QOvsvXOuDyqDbJF\nYP2O2jRh1igriado+l6Bw09j9pV4aTU9WbaP8ft8Fq3eZEoZpPI3T5gfyvTy\neeSJm3S0W7T6b0ih8tPgdnXFqgZmNq9DAhPvXUQBPkmtmRl55PGA2pfVSLPF\nNfUSsNfbgTLzaNdz2hEj1MYGzJlPyh23H+qq98qk5WZBQ5+y7IVn3M/Lv34W\nxwXaBhhYtRiBSwcJU/4fSP012BPYJL/si0H3KPFh+7prfm/qMwPh3nUyGdER\nRNpXrLFRTqhl86Mpi29CCphxwFnF3fVw9+3VMwV90nwbGokwUOEm7c4UPlmy\n8AZAL18B6DYRY26ePOEhEB4aHc8z4D+n2fwaO4PPvgCE4KafE8deVuGOM6XC\nr+LloXORHl4jHWtemfqu0ZxYGc6/Zd3XtHzDLMcwwPOjc0QpH+WXPKseWJMO\nyHAnm6zei0A8kNe8KVjJwd7yiiH32/1u1PnFJpo1MNUFgR1NpzpTYfbad0I6\nwIlTQu99NlFBB2y5B60hpirNtpc62t3YBDFBn0MR50U+GtTZm+CR4RNHE6qY\nNlNIA4cpvpuVIq0WUxj3bCUVfn/9rkJir+lAse+PQlWakLkJcE+8QOOR9fer\nDFtmo4Lq2H6QZjMA60f8psrlhT83bEx44JlttNJwx83xRujSMIgnZKCGrFN6\nRThC\r\n=mbcs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQxca7LaJ+ax0OBysKRsLn8hev856Dn2hIDgefPd1vmAIgYLbzj42AoyCqQ/xyjf+P6LuPuek6Fmwuia8BUioIHvk="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_2.13.2_1537806973422_0.7344467151836158"},"_hasShrinkwrap":false},"3.0.1":{"name":"next-offline","version":"3.0.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^3.6.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"c30b37db2a094caf1748771d63734f560889d7a2","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.1","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-/Tp/HlxLeY5O8+amTVbczc3+q2Ojnaal/47biTRRVO9rhfz5YodCy8yLvRPxPJr5ldu32sv4dSu+goObvDU0RA==","shasum":"c4dd43cb3a30201ee26d4f8be34b0644aab306ec","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.1.tgz","fileCount":10,"unpackedSize":102959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqRe0CRA9TVsSAnZWagAA97UQAJVvNcfyau6PP6oBaCs0\n30IPp6863NkLqjEe/zQ1Y/kKGVK1358zgp/rGkoIECDIq63bA9Lf8tnZ7k7Z\nleMRkWCQ0W0l0FKXqomKXLS1cNinUJChS6+xU8VLOk0vdi9lgBaiIDHxcHzS\nWSdph+L+g9zgYUYv0e6MCdv3B/9RwKV1hBNsN37yzJGdHXpcTz+/NJ4l/Y1j\n96ciqbu/I3pSndO76bv31584PxFVaFV3bpRCQoQ2oARBTpcaiaU4MRES2uSs\ncZd4GOu22IXFMluR0fSM8MowcPSP8YA7kyHdx/4Xc3rWVDntJrhvOEc2S05+\nnrmYvy4R1gXw6Vi5X2J77dniG0+O173q9/PfEBcHeMOq9c4wATIzx50HP8US\nPvSmNjyO+C+rpBEMAKsuwX3ovLS1dLQUZMpSs8Hoscw5Pr0rKXOeW5YfeHd0\nR96AOtKJiSzDod4TSHquIDs1oSJbUFYw0gkolKZPnX2z+0hfYaaEoDmuz3fR\n2UauVM/TX3VT6QEA1TLkgB4NENAOT0oUDB9wjQqBdNNW9JDtdimRvYnp3IP5\nwKTHrM8VG8KDLP3CHJLqYeMoQzGBn/2Zlvvuo0TP3wCMvzdQ+B6hF6A9OrKZ\ncL3BxgAcYC07N7R2ZjsbaXKG1MiJwZKG3v/WZR8JG0SUlceAyCZbyW1rCW4v\nl6M6\r\n=KTmg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBPZIuTkRS/AEAiNj69yb4xF3ZRyCk2FgolPl+shy45gIgEEUjig4DryJoMNFzh9bn6CTOdXYfdkeGfteUGGpKyCA="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.1_1537808307370_0.7035131570366953"},"_hasShrinkwrap":false},"3.0.2":{"name":"next-offline","version":"3.0.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^3.6.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"cc4f4092e9c1166ebbcbc0730e47b65803826e94","description":"Use [Workbox](https://github.com/GoogleChrome/workbox) with [Next.js](https://github.com/zeit/next.js) and easily enable offline functionality in your application.","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.2","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-StbiFmgGZzuxC9wyP3P0O+8LU9Hg0RdZvSVZ5eyB7NgEeTOX3e1WM3BkwMzTAHRovsVFv2yFGcCjLrJb9H50ag==","shasum":"da4b0e42af2878334bef626f00e8c4df444308d8","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.2.tgz","fileCount":10,"unpackedSize":102957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtjakCRA9TVsSAnZWagAAwfUP/0Ya+8zpxcRqmM4QUJFf\nWdXSNEoO2lTY2mTz8R0DKRjSoQX99oBgQhiA9fYBkHDh6ENTalddeDfjCbCN\nIaC8Kgm1EkE/TRFvP4Ppy/ROS4bFv1N7sMnkPCTucYP9k9dCzesHLZ8MKVZ0\n2EdDW09KZLv5sOmzz1ch71i9ybmv70eA3Qha19Eaz7QTI9LR2x9F4llT8Be8\nRv1h1o8HGk+dcNODYBVmCGrRJWqrq9lJiWNik1hINtw5gg52u5JWAvNiliy4\nvrzgdHq+JqbtEwieEvR/W9E4Gg0ZChEo0TJTG8767RvYMIHf7k4LxkIiCcIg\nmh+ByO2g09fmdAmt2wFKep/futtWlpNztXTOPWOLgj6LCsQrjQjeu7m1ZESB\nBy04U+kWkwzZoLambLlrnJfOKosDchhtOYS9g7Jwz+I1L1aSjpSX3BvBFmKK\nJ4dvmcRUHcJxJKiCIoD+KpWVqB/vV8gy5EEElF/IhZveh0Ga8WkIJ3gREXbM\n8aKXbMAHaRohmpqKqsDLNRM+qHnTpFhRBQRMfJFyH2OMIg6Po/iDkSubfxNI\ntZJAzHXHsMnoait4Qmv24BCO9ws34XIKG8T24SPy0+q41AkTDUC9E11XMCyj\n000yw3HoDM8FoHJ8z3sWf6AxXI9VFUGpfKQ/t6rYhatX7Ao4c/avhZemp2x1\nkhux\r\n=znEi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgRzuHEFMESe4ho+E7VXTsVhpSdYQEVez/v2neYD+EagIhALArV11nq/KjpwwIllEh2JMsg2l+e2WfeQsTiWQkdf4q"}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.2_1538668195695_0.19582582961327932"},"_hasShrinkwrap":false},"3.0.3":{"name":"next-offline","version":"3.0.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"47e8c6a40953fa341f70546dfd85ccb5bd32c9d3","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.3","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"jackhanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-Jkh9l/kB0N83J+TfRztH7CK3j7i6ruLBS4asTaTH0RtjoKjoyetwOv91A5JRIreq1YozmCM95Iz+lTGXw9Zsgg==","shasum":"e5ff080c953b663add73451c675edde94e89bfdf","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.3.tgz","fileCount":10,"unpackedSize":103491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzpv2CRA9TVsSAnZWagAAj/kP/joX6/vzBRCdfopryWUm\n8jA/QM8ogOosmxjaDFO66JA6bAUerOK9hBmViTO+1Kp4bGCQ5Viqd9Xh7DUw\n4PHuiym5Nyz15SCEuH3i/Lv3BYY82pRvQn4BzZgF4FwHUklAUE4xWqoZxHZU\nSKHC0r0dqjvGsCN3OcXNEzfaUn5cNSZm836S6Mr8PoWVUkOGFTy98G7iV8mk\nX/5Yu+Tm02ANuQs0tzHUDzedFIXLhFrCf3gSGmtF9w2us6jVqTX8JgkLH3SN\n3hYxeek9d7kaMeaEGVdrc0XqDYn9wywt696O0H4EB+NkJlZgKrMocUO9JkOv\noSbq8mBx/JO2cDvF/fsbF7jkEFPPQfKBRDkViAlwWzkUWHrp8LFEu1qBguLh\nIpms3Zc0T1p091Th9sP9yU8SjVrvVChtyIOHHyICs8kSjEtVp5lfOwrqmS5P\neJJSxfTDMXZQ2mvs02nsDJiNnFdgWAzFPI+W8ZTEFR1Pk6jtuCDBZAd36wCI\ng0f1QfiaMAxGxdGWJbGVQ7odrmeKVqgm80SmjV8xDMweMnXCLjTOhqtF4i77\n/FpnN1rRX898LLjWqVydS703CAMFZ2EdZ6vJwGH4wqCC1rNBj0deIuw+tBHd\n3aPtgjfynSHirMN1iE5nFRHh3tfRc8Cwlv6IMipWMyd7SCG36Xz53gOFI0Rf\nxTDG\r\n=rIFn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAbx+chhmZa2LcswynyVe07Ts4jEe7FCdsTEcNEx4r4wIgM2SqcmKiQF6pVTcVm4WR5s6Xeys5tFBq2fgMGXZAiQA="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.3_1540266997574_0.3477830741182646"},"_hasShrinkwrap":false},"3.0.4":{"name":"next-offline","version":"3.0.4","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"b169757ad3c93da70518c7507f59595eb9f35ea2","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.4","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-GwrRc0KYBXq+lg+eP0xOmYFm4KcJCS2QuUi5mXPoqgH2SKqUqagZlKyaR9OSMjna7e0EIgN/OVnf7EyTAtsvyA==","shasum":"4406b1ebe1006796caa3a50e6aff9ae218e739e6","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.4.tgz","fileCount":10,"unpackedSize":103465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2kyICRA9TVsSAnZWagAA6DAP/2G//YbIPP+MR4tcgV8W\ngZSIEux7/yVq9LdhLlu4nBt4ffjm2EkihEvHETiU/6hQBY/6XcK6/YEnNMy+\nLMRTnJFyLrn8kwFkiN4X8pTGoi2nvgqj/kbrSVmuCSj6aG6Kp0bRzTxBfbKB\nwVk0W2lMYjIbmCSWTGDuLeF/iNt6RF65RjYIeOqC2Jvxq/mC7W64Mf1ZkU+k\nEMozddChbH7Y0LceVWL+OR5DF0dRHRPz3OtFkpiGuaBbpYrt6MOAUwPr12uA\nMxx1WbeBzDXPC1adQRft2NhcCuc04aI1loY9qqSiMU3A/gks4BVVq4yOpvbH\nLpQhpewUSO5SOuK9QDSVWU3kiz9nia8W5auUywshKLOmEeEVE4BuATtirKa2\n2e6FS66KuxgL4pslSUzj1b/NPlihwUBkc6ZtL4wmKci1P57Lqq/Gd3wVQ581\nL8s1hrsLmw1STkoVN8lTXBa7sEu6d1Qt6/30AE493B/kFdjX5xbyQWVxJA71\nKdpvkzK5sP8o0XomWDnE8SqgBJC1X+nwmGKc1t6gOaZO0vuWDiP854vSnpao\nWlheA5WllrnUR6Nrw/0sOxfcNZ518Bi6E9h23EISew/0RUEijGNMf/JHX5Q4\ngM08XJv5XqRuKdPU7e5qTQy66BrErC/T1x8vil3EhljVUZw7KH+K/WEnVYTq\n9h0N\r\n=ffCi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAG7nbgyRfNmLIMXe6waUOmrewGhAXadoo1zJosbp8UeAiAhzGQfhvxAtctfgPape7ojWEqZb/6QhPqx1S10OlUwFQ=="}]},"maintainers":[{"name":"jackhanford","email":"jackhanford@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.4_1541033095510_0.7899112258918131"},"_hasShrinkwrap":false},"3.0.6":{"name":"next-offline","version":"3.0.6","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"d6c842b1faff946e3602e93b09295bb5b86a5d3c","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.6","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-utTmSxnSrLXl8vqAzyb0JFNFdy3mRkmHOdxONdW8I/S4SxPTuGd9ytHyVg6cuyBU1euhEBRax4Z7HuVdMZgQ3w==","shasum":"e1b7c8e1c118d4e36d8b05652557785c5706f3aa","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.6.tgz","fileCount":7,"unpackedSize":13317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb53MBCRA9TVsSAnZWagAAnnMP/iutKomal9mR7qFeEI60\nExpfUJdMxsDt9G7qFYQlx7sVMgiHRRNcewIWMxur6b03bi2qtdrJgPA5KYGK\n5wwMWicHH23BrAQjFhLmNuYUCLFPJHQktTEzsfEJCIbrb+zgfI0SF90Xlg/k\nbm+aXG0JA6H1/7pHrPzIrwUCgzbFAPfJZ2c4W1nQ4FMgjDjonTSs/TbHDbU1\nuOKs0Oc2QCu3/SKG/pYJqCqQEb4Lefo6kY29zsQC186gF1M5c9d4G+FZWHyS\nH97NTZRoQltTSJ52ar0jFmJ1a4j9/xIQqLcPUhgDE/E0QQA6WnKu105ESMOH\nPgNT/2GoP7/lGZ2zopS9nXpK2DENq+JHoDgwUlcwNZ7TFxXLKS2VYedfUwQk\nYPSWfo76AkMKJiu/ebybAnqCModAbVKEF55tZen5Z9/O2Wf9Afakv25RPaw3\n3DV1+J3m7tWWv9P/flF0qvD0LWO0kmhbglyERLlaTNzJ48+twm2X/v9fJSvx\nT7sXIuLjEhKmQBM/bXT0+61PVolSOtlpuZiowKCQrjltDG2qSoxnWOMzynT3\n3gixPFILGKUzncnGjAC4d8P1vkCu5jtpFz4ECAKl4nfNyaNDytCunsbRrZlJ\nAsKQBD1WgyGhPDuJNMreK5uuy+suDwpK/D3nCd+ABEaUE6MYIddhRylW3+r0\nesAz\r\n=0qYP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICnxFbuVSfByAHeAJZ0laZh1+5pJyEq/H4wMY0aPET6qAiEAmXpt730XB/YRh9mreydZPL0uu1y6gEkt2r5n8XWy4sA="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.6_1541894912641_0.18200055436694496"},"_hasShrinkwrap":false},"3.0.7":{"name":"next-offline","version":"3.0.7","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"c62abb92b4d1bbe99e41c5ee81f46280f9ed2f9f","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.7","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-HRVjXe8pg/DBCJStgYyJBMNakZK/EaEMJfFeqfc5uL5ZYWUTpDoyhxhjFLoI2Zejy0bace2FroPkn/6edH2TIQ==","shasum":"84a54c74f0ae95e37f102ee355fdf44c10639daf","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.7.tgz","fileCount":8,"unpackedSize":13698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb53POCRA9TVsSAnZWagAAoJgP/A03dcqlSFfWB4hCV2Hw\np0kSGFzCy6bf9vVFss3zrGw+p4FQ8a+biZFhTxqAil+V4VSV3YRY3Qhvdu36\nnjyln5MgiAAqwf4gT26KmpXczUQXAR+FNz7Iu0eBF/U2sP7lyWaGT3T0NMWT\nUJ3SMYU0Gz+Ye0mfev7N/YS2SX4+RuEMj/uVjr4+gcKk6VxrJAgAcge/aVa5\njGYC6BwRGkMFBtLyhyClfXjPSUwhCzSMeEWkg5UkCg3U6eSPKA6YZbrrPxp6\noPUrO6WRirgw725j1nOXBmWqEohw7FGUZ9kdApXf9wtpfwNXWaYQ9sRmPXM7\nL3DfHtMAaesd2B/2etXAsmFXgD32+eVOBe+wxQS+FOz+c1BiTn8mon1XrY8e\nUgy1eKRXGRh8W63S8ahqmE9LUwoooBozs1ctdWhKuPEwqid5bi8jhbGz27Gk\nNW3yZnBf+x+5G4YdVeKPMWxTEflroamiMHLPEtOGI43gl4rjAkgBLhQ8QFR2\n2Jni34alRZEiuGdImuBSwQE9Ikh+mLAO26uUExbXVTK2b/vtu50t5aKrTt+G\n2LEZhko6PuA0b2TO92Nhd43Mxlu/wHRTzy2lWHl/m2pvOhN3/2KhfRj13Y9h\nWvggsB97hlj9QqoFmQPn63ETKtPHf879r7qDeOhSRonsOSHPPenMZNMh9T0d\nVrfH\r\n=9X2Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGDb66khiSEtoHvAy8viNwlb23oSYmUrzvfSKWtbfCc2AiB6ZMs8p9Kf/su6azOyI+jJ0P5S6LM6cJ8fxQxcq3Jozg=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.7_1541895118017_0.8177684031748793"},"_hasShrinkwrap":false},"3.0.8-beta.0":{"name":"next-offline","version":"3.0.8-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"c62abb92b4d1bbe99e41c5ee81f46280f9ed2f9f","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.8-beta.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-XWggqe+vIxgEx1bkoIkVzCTGZ9FzDtnFwDjBQhI3mVDBSl12Xz3HPt+55wOvIAB7enmWTrZgGL64Ye7nVlt6IQ==","shasum":"c0ee2bb0f067034e441bc31a46358634af2c2bb5","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.8-beta.0.tgz","fileCount":8,"unpackedSize":13699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb53SvCRA9TVsSAnZWagAAxgcP/0YCEr931MWYfyWpJNnS\nPVNdsbL6JVSwZ0DJmyhMurCfGdN5JbCkzeMnlIcn3DUhZEtD6qd9CMAn0gK9\nSH8MYtZ/CwOUyrHBquSaOeDegtG6mALqJpzeEgtW45AoyMyJQgXQI7pt9vKn\nBNKEZtH+8xZE9DU30ave/iXldlM5+Hvh27MzNHxXVWBGKMkmYEwkKSoJ0aKu\nxpV3XVvnpqY7RktU8PvPeBhRPfXaGAhH1nWm/lX0gQXTqb+XxIi/TWatC9df\nrSnv5Z0ZcVC/r+TZEz+2gxMRIXePKRBCalX0k0FpMK52X+KppLmJp3SwiWen\noPq9Gp3DRiT2nM+OAhwpM7PKAmmlBmN7x4e+xHKfmhnx6xGXJ/T3RofwClZu\nH0lEgZmdG105vm/N5q9z+0p/T6F7bcj/Ge/HwtQ6+x7IWiKWQ/QMwsy0V5VP\nwrtdx1VVFO9z92thD0ytFCwVygB4A+WgPzoHlgSJkAH3nFeX4SUl+u7MA2DI\nXZr2rMY9IP92DTAN6bDalwxxsNVIbJJdYY2WC1g3PXw2eVOxuzZQvNJuyfkG\n9KGQgil14CEntpYu0Ukz9yzXwelnPgQ+teDA4iEPbrTNumMFeiA/3y+6bd2R\nlAw6Q0Z10OqQ6XWQYDH75rUhrOv6lpBvk29J42CfIuS7cbS4B3d8iwZSNO4M\n7se0\r\n=9moH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA3HsrIhYo1px6equ6Ok0PHxw2NG5aXukROLdvQiVFIOAiAr+A+a44PlR/9eONcd5ncS0tP9v3fpam9q1JCcVECGxg=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.8-beta.0_1541895342870_0.6054523662783116"},"_hasShrinkwrap":false},"3.0.8":{"name":"next-offline","version":"3.0.8","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"478fa120dffcc6ec39219da90078196373e1d454","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.8","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-6Wclx9zkDHNZtxCXwRQL1uUGXc/D5urlTMElqVeRdA2NsHdcxmL7Zp5hml0QFrWF2rt3/TqyQA6LGEp/MMyEog==","shasum":"25360e782737a5c176158714fa30efeb74081e13","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.8.tgz","fileCount":8,"unpackedSize":13698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb53VeCRA9TVsSAnZWagAA6vUP/jsz8oL95eQV49nm6Aug\nZk3cj4RhtFpsz25OFqFg4vzyh4JL+T0Dc918IUlFcKTQx3fENkT9NwbsxNdF\nMdGlgrlc+/03cv5SuDt4OUsvn8584XFQYMtiiIz/DoCHKgosMFKH8LW1FGr1\ntt0FQRkERUDe2CPHvi9jW1eaPd4F5thEd95Jto87ffo1vcvJMQbE3c5Aente\n10nj/KAKzDa3aniT+r6MD40boNRzSmXYb362a8OQdUaQ/RLxOEV9D1UxDAz5\nXV7fihPEU8M1i7KYCEjVN/CWE9cW1YTg95jCIXL/WxrrMHLeheewqAS0Ij9X\n+PxQqmusW2sm6Le+lkxyYxEjXqH9NdECSsiQwtLKg/dFssOVS/zoBNECaUTz\nP5y4z6P6GqjplJERrhSScaKT3wIl7DiqF8wywKKTjpRZP/R1z2cgDRFwg2Cd\nF0VAE9V+5gqczqyFRU7LrlIj5EP90ohuKSY6a6+Rx/WZZel0wRNlgOexlxit\n50QFQmMVDFBLeOvxoxbYuuxbzFlZla5fp1VSBY3zSPtDcKAnja0ofbrmXOR+\neV9z4URRNGg7NGTqnPn1hKQRGNXT5gGpgh76RJpdVPELZgD7frWCgiVMcWFb\nTUIF1Rz5BLMfzdBcP46lCQldksfSO3sTGHXkckRqxHt/UOZa6SGTt2CXzqCa\nivdQ\r\n=/bHx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTJAZcKW1+EiECpqXktHgnEhBD6/byW7tRTERm50ZVywIgctX+xfp/mJq6l+mgPmQIsstvUJZWxk1v8sd66IuaVIo="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.8_1541895517912_0.9186990950737273"},"_hasShrinkwrap":false},"3.0.9-beta.0":{"name":"next-offline","version":"3.0.9-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"478fa120dffcc6ec39219da90078196373e1d454","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.9-beta.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-+wwfdj4jNKgYlkDntsUPQfAA5/XpWZYzKslyXGTGCNIFZaWYqU7AJux4ZgX2FT+vpSlPPie+q5fLdWq78hS1yw==","shasum":"8238e7257a40a86d422dbe40c838cf4fa475138c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.9-beta.0.tgz","fileCount":8,"unpackedSize":13699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb53kTCRA9TVsSAnZWagAAQhYP/0m4f/OGsJGYJm8RjI6m\n1wXIX8l2/2I4kVfUqLp5Gd/VXFdg1ZBZ+YRsaq7edFJVrrxqwaFIDn9kn/LZ\ne5Hs/sH2MKI65B/fk5Tvj1q1dD0pUTR9mVR+hznnChBNdbMsTDwfGnTJ4SE8\ncA7TL3RN5PUSh7QY9YYjbe83QfDRsjxaQ5qrm8YFwcvhF1JiVLVfKDRsJ1d4\nacOO7FJeDLd2AgrrA4NH/4Xsi3xaD30d0tHRdxa/izl1KnRieNC0PdaCmR+s\nPa2I98r9F0qeYps9D+fm774TDvybZhr9nTSENyyNizD+aOUHJItcqTgQEzjm\nDDwe21HHFncykfOwEAAabCbn/PkoHKeVVG24NCnHR1MpAaonPKm5XuU01Z06\nKdMEeDVyHBtmfIUyVrgX+UhAFregu2J7PjqRIYsVt/oK50PM69qUR5M+iP2b\nHqxwLw568YuQH0Pv8oy2YmkMrFFtdM7WfQ2Tdk2bu2C3Az5izrRXOAGhDt2P\nOXq3dH1OaGhlMprHwvZpl4L1GxtRzVrZXLf4/NTNlrL53DCzOmbBe8A0aq52\npdDch84kPpk58euq0w3xvrlULy8CqIr9qmn9YWv8duucJRMjeoVoHzrb5O4K\nLe5jGBGSxClz33ZXvHeXTwWiykvVeqKeC+rYtGUtXnRYtE4wYbGJ65/dkH1e\n3iYQ\r\n=VwE2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC22qc6u9g0ZazE1BwVuWt8NjqYyk+JgaLYd+NtKXw3GAiEAmDHpL4uy6IA68Xf7T97D5I7r7xCY4yFIEvK6ZhPBGvc="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.9-beta.0_1541896466772_0.6223973910416918"},"_hasShrinkwrap":false},"3.0.9-beta.1":{"name":"next-offline","version":"3.0.9-beta.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"478fa120dffcc6ec39219da90078196373e1d454","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.9-beta.1","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-Ld4sEi6fAkaPt6yUnXerAGEhw8C0p4MtpBYH/wx4xD/I0sTpCx8f6X+1xlyAsnNPXWnloUVaidWamhcp0lGKtA==","shasum":"f127a078e7172a8b7f142f109b77947daba34e88","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.9-beta.1.tgz","fileCount":9,"unpackedSize":103637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb53owCRA9TVsSAnZWagAASK4P/3qibKkrNuqkgtt7194K\nGanh7a2pQ2e94T2C9IB+yNaTY8jnDcG+TCSLYCB92YAza9+fYTwDJlwvyRWI\nYRm8JZ5RB4geISJm0418GfWgX7CcRyPDgPIIzZZN0myekYxi+U8GcOGSCgk9\nUCZJeG/SFo4pTpGoDHnyTmHykAQtoqcI82k/Ti5wnOs6fBKzXdYbhd+LqcBq\n9UahDiNd6QiTTLBMCEtfIMoAzLPq9/g/MfvHGsZYFi+hnvb+ubBmlCfpXdEu\nwCBy3aUh/G+NJ0MOWdhCPDjrRB+P7k2vqT1BaWTnlX25jVJhns/ICUJLp9g9\nIKbiGl+sOljbyL19ARsb3UgwC62Q3YJEp7T4PR6JMvWRkOPc6k+TrH/BoKTV\n+pLsWK+sAuFMPuesryr09ilYO3PJsnHV/GXEDZh5n3i4WG4IDBLGPi+bSLpR\nfB1e6SSF5M1ohOPj/tQAttWlANnbW9NHJdb63bVzEEIQAopE5gHhWcWPp8vJ\nm7wcjDMNGBRQjezEkXfmxm7CCCgOMJlAdsIxJEyNRfGuuHmp1COyuTWgqgKI\nArZ4q6URDTZ7xAaVQJjWcaYxlPFWmmJFQSXH4RIczfdKCuDJ8pNXVzFtoph/\nffuFvjm2uQKNvckrMSgXKGV2k/49oO1UviwVxIepSanyjC6qSEhT1iPgqD2Q\nSn7p\r\n=Gt++\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFsB+U1hMlmL61ftZ1udggN7XqkjaCLC9ORnZWU8hIoUAiEAl9gM9dFzaqtnocgDyB8JtG5R1REDcHCpQ2G96ooY8mo="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.9-beta.1_1541896751908_0.4546258284200875"},"_hasShrinkwrap":false},"3.0.9-beta.2":{"name":"next-offline","version":"3.0.9-beta.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"478fa120dffcc6ec39219da90078196373e1d454","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.9-beta.2","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-8NIFj+HwbEoUji9KcAsjuD5mQrYJPM0iuWwqO9/QC5D7f2wakxasXc3NofHBke15KiwKa+iKQuRg4zPKBvvwIg==","shasum":"0340f30c358af4495006837b25041ac620b2d429","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.9-beta.2.tgz","fileCount":9,"unpackedSize":103637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb53u+CRA9TVsSAnZWagAARpMP/0SasbJV7qc5K+4rqFne\nWIZlhC7s4MbrzANjKBlzY7HWKXtO+FcXlpwI4ABaOIO+7mk7sOfb8KCejPpn\n+CAuxWTbujBimymoVdGPHeCmGxh2kARFk8DTOMO6MyLYP0uQrKktml6yQRhN\nUF1dynWVuT1C5uo2VlcMdR04XQHXCRj/BM0XSG5IppbUtlmlzqOEXEkIPEmk\nWHu99l8LWSmid66LPt2bMf2FfQgZdDB9U0fDx4+m3bMuzsqUfKAlBnr+wbmz\nsYOKvODQ9HzzSt/0fH5ceajtpXiQCy7Z0Nq0motLudOD2a4mM4jsKlij5Opl\nW/qBzD0hMWkUrGO9IIZnAjM47Q8xb/s27Uh02umzVYg1l7ppXo880hAE1xNC\nf6KqCqEJBKBmA4WXzVwj7wWRe7Zdmi9Tp/WUD+zDcsnbZVwjpIoCLv01VaLe\nNuBQwLjveWm5qfsBiDYjAILYaFuwFEF5X1f5/Eo8VXvHvTAUjwLSJ+XBUl/H\nwJQsu05befBOO34XrDNi5Dz1o+JVjTlpFaFZrjvxeWsqq33SkZbHd4lX1MIr\nShRgbUl3bBG3ZftBdjXAYQYH9vGDM61nbSiIPyHb5xBYX//U6mYTWKa9mxhT\ne33yh7GP9MVl/M0wfhEHxw6lLpSjvNHU91GppCmiQhsUZfCx+GhWevUidESz\n1mNh\r\n=Cyoa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHdx8TM+tT7PaHUOAx/ODwwrAtLsOPgbgAl4z7dU2Xw2AiEAzdwsH3JGX8KljsPrQ/EsVwnqKZa2OPPlJ3hRZiVZFWU="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.9-beta.2_1541897149917_0.40609339514624665"},"_hasShrinkwrap":false},"3.0.9":{"name":"next-offline","version":"3.0.9","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"f9e7fcce03eebc0bb279a79eda9c64fe2d3efaf1","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.9","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-ADrfA4aAcFKSXCZ+pgIO4oYQH4rdSW4Zzyik/TAJ0O4fBLBFaJf5ijusTWbcR0wpTdik5GYtShfDmuzS+6DA5A==","shasum":"511940f5a0f645f63b4b209165433a7bad632b85","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.9.tgz","fileCount":9,"unpackedSize":103636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb531eCRA9TVsSAnZWagAAvgQP/iucgis3zPv1kt5HoxZq\nMwusvmF7wko1rKVMY/rTdH9g0NXmums3mGAvAeYB/eulwe/WJNQK+t4Pwi3H\nDZfsjRwRBf2cCtV93hdmbqkFP1A3sJ7wIZ+g1TbiAMiKUzkrOK69M9w/Wa/O\nXb5iRMFIEVYA7E/vA5qC0wYoQP/ZdSBpUC+eV/89pfOojqRvcl6OgFoPuhgw\nvFB/emhu3GpNbJ2gb7sz4aQQdFFvr+lhmYQZKMpbGJBSO7vNO4BKEDGdIF+w\nsSJ3Po+By5m/4THG43ipzG32qhITEAcwBHVEgXyMOwCywuRSBhhFRkhL4m5p\naFGXgsZVBZbCviaiA60a/k6pVbJ9JRO7EnZcIbhHR4Mx3dfsfmXR2A+doU+d\njtKfwhTTcUoCAufCRoM2qETkXj7fI+blKG1p0WtY0WPbt4MYq4RVdpKOsc6a\nf5rNiAeLa924h7MTHibNbNwnPEwxLzxlQlHkZW05Z+Cef58DGLFKCFdZaMuu\n9ShC4wzzbTlYIJBVjfv4Mty7T/fF5b5d+QSJuHSpifuIufZ7eO+TSRqK9SnL\n5v64yEEdbmOf9okQUw8q+2DUJ/9E2fqOT+OEWKH0h95EYqiNecqQjzZ1haut\nVWblrWoMoHOArhzQpPG4vNwDErelfoaB4or1tGKhNBV27Qb/E+YIjEMrM6e/\n9onh\r\n=sEVB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICZ0f54wILmKSUdbcabXkk18TSiOCS4PwVFNer/pNRQWAiBqrtepKDEVlxSieCY5VOVdAxept+rYWgo4UmdXyg3nCg=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.9_1541897565569_0.7700852409591052"},"_hasShrinkwrap":false},"3.0.9-beta.3":{"name":"next-offline","version":"3.0.9-beta.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"478fa120dffcc6ec39219da90078196373e1d454","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.9-beta.3","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-Fkjkq94C4MDUxgLDvDVlB72fHTEdmJ9wfLSMwoYa1vrxoO9lKDHs3vfLmCSxRAWJWuV2K6X11sHv606j9e+UuQ==","shasum":"454c7433e01587fe6d8b7596f0d534b204b2ead0","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.9-beta.3.tgz","fileCount":21,"unpackedSize":359440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb53/ACRA9TVsSAnZWagAAbO0P/ihD0KtUG0ZeZW41Bv6t\nprffbfD2t76119Jxh2AP3mx/eP8QS9piuCwSPCLYFduqujCBfIAvJG7vxr6d\nHP4CDJ5J8xaAh0VlLZDHJE1Daac1YeOR3caN2RMg70En49PghcstrbE7C3Qy\ncpsk99mfVUGjImK0kd2W+HSSgb461hkB8k2tGmpTaX1Yi35RoqV28YJeuCaN\n6e30cD6JtGd0U/9wc5stYmWEYXjTKy23xXyIoz7v84BHmJLga6hPLr5b7dtN\nEC99eJvUtG/aPhGMxVbr7DvB4Dja14bsGiH0Vxeoz2WUU1E/w6tdc+GgzWLT\nxP6rbvD3ID8eyZygzPf5GZDSs3EfTiJjHsCUHhCuFdRdtK6xvNuOat+2UU4j\nwNq9J/P7HCax+D4akBuXPBZTGAyhHgAdqB1j5y1jNh8TiJiLxAU1yl0WrTvD\nlAysLvxALcK5MNLcck2YA10UHNGpgOBvckNel8bnpK3JcJqEbA8d9T8AiFam\ntIK/AdcmOR0jDSGb7yHO7j4EnCfxRzAXlpE6SgSVD2bu6SF6OqJWgBq//ruL\nkEHlYvI7NIW7pe8Bpkj9SIV9JkUeqCsSckDcyfZI1kO/7/GPMwYory+My68A\nd7jpe8SF7c0jE4UKCGjUD2kjvAtj1XLEX1T9V+Z5TwOQYe1PmVAjQHNubW6w\nqM63\r\n=uMGf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrHmWfeR6MDGxVf4a59neI8S6MwP1VStEL7P+C2kz6eAIgdkKshMy0HoXbckJdxLnKGiV9ALHSSXEqaKQCCecymiw="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.9-beta.3_1541898176019_0.9278274778092952"},"_hasShrinkwrap":false},"3.0.9-beta.4":{"name":"next-offline","version":"3.0.9-beta.4","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"478fa120dffcc6ec39219da90078196373e1d454","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.9-beta.4","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-FXldcyNZ5LTbJ/T2kQoVBDZWyLo0C6U8SsWFu5PJWuSz9ggN9L5tRv7ooyreIb7qA9gFvMeAZG+zT4hkRzV/wg==","shasum":"5b0a3e33a6efdc87f31bc0e58b78e811a3edaa01","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.9-beta.4.tgz","fileCount":21,"unpackedSize":359434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb54ABCRA9TVsSAnZWagAAQGEP/1l37i2+4n3yRzNvwch2\nWZHtlAzeRQB8aIHW+HeDJkxQESSaT098OcLOIYfZvJMi1DQMcAMORvQSxkg0\nbYR9yvhFeF8qviNeiUmvLV2HBa+FiznUeIC82+KrLd1PnH6jFbTKcIiZRrSd\nH/izGJy2xaLg0y6FPQz79JMuoNpztDFHwgm7zcPu4ZFZDSKzkQbJOgiGG36/\nNR2dIFN/Qd6Gbnoz8oZgroKW7qlYq3rpydPJ3qiGFs9bhIrRcuFwOv+m//Re\n0EfHGTuINr/cErtMRnDSkrMsr8P1VuzvcEbe2I5kbF0xUcuu+jQ7Zsd0AqMR\nVGxNuHUb1TG7IepBq/Cito49T+T1udVMj94p+BDzqrbea+O3kxC/i++cVt2H\n+4kitvs4Z/aJ6pXvP3PKUul6nzKhSZFwLu4BEDRGnpBDB6wibC849LIjwZ17\nrKUW02J4LIKCzlxdWWD95r16A0ZB77iiSf7gyJVdjG/J0bY9g0Qzh/Qm3Azo\n19Vamtwxd8H5FobJtUhsK/YAeF1Z5OlJ3vibN2y7BOE1xDU44f7RNdzD3Btq\nmhuZiFJXW8HE1Czqm4SgEDbaUgMcs02PM+WwpKju+3tL0opISgCoLFVpYYSl\nBPvz7nHStftn8SHHyuCsTJRBQqbkSdHQrycgisIrp41otyRTMwpdfBgo6itL\n5A7B\r\n=ePhL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtgnnE8s33I7xWh32LNf0K4LefHUnW+HMhAj+jycn2BgIhANMVXxfkvnThS8qvUAcHCfQQQtQU+oJuM4XaSvNaH2su"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.9-beta.4_1541898240763_0.13374066155276254"},"_hasShrinkwrap":false},"3.0.9-beta.5":{"name":"next-offline","version":"3.0.9-beta.5","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"7e36b071dceef2e0d16da7be997338108fe9c5cd","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.9-beta.5","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-D5QtO4OLjEdIAS5vIedPzn3qtHgZdQz86l6gmOHiint5ZYpxaeLWbxX05YjV3F72xkJq8/7UcUZRvv0QjHodqw==","shasum":"77531a650a0868b129e1be02b00c180e2c912e5c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.9-beta.5.tgz","fileCount":21,"unpackedSize":359434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb54CCCRA9TVsSAnZWagAAFHsP/1kUYuI3F+mxg0J8OLQ7\nraK2MWyoAzhxA5J8F7mIxMZQocpz1QPerczIV0QCEWMdRBJegaQ7sqH/VIpc\n/Q1QVIUproHNx/Flc9hjKJOecDsUVDL6w/NU+IaKEwdXbh/Iu/aCPc2IBOwq\nVHArhhwOHJZ7ReYTuCV/AIB1+rgeGhqD3NJzz+Hd3dQ5m/Wyg6DrsLJTfZJB\nzQSOzD/t4pEA6kl1aNZ0IUkEYPX+rFP9Q262iVkYMQiwSAJzn2AEWB7KOSfK\nX93R2CBbHZ5UXZtqaND8vu7NynbO8IJkxxEHrnrVEzXO68zUghc+Rz/57uiv\nfnzRsODXhspnBKaaxQ308NYQ27iv5LViCZmb4Qo4fEEUq71uWQgtn7nVWwkr\nUWXEhf4CueyEWOId8igVNUVvd6zHUgXbQzZJxoYv1rNck4mXf6njmw1uv4P0\nw13IcxkfV61TBr4+Suz646qgyzGCoytxOMRDy79NbR6mQvxKCL5jFxgAi9sl\n5xz/uIP96e6o3VVtrcc2JeipXynSDf5CPV7qvwx7vHfauaY0+l4J0ZbWz4GO\nZ8yGeK5qFglxvgCD5z9qH3i9bvx3KqdRkX8R66jzDABELFEMnve+3t7zG/1H\n/rBmPZmhnep77KOgACJQFHbZt0hqU7Ut47B1LTa3mgolpllALQXEEotgytHB\nYiQQ\r\n=tEEO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCemXn6W6B26O7MpgmRGE2c7dIGpW+HHHqAOt1uu7RI0QIgS5zmBEcg1fiHwYRuwZu8xsmDvnuhBIt5SthPkpFsZVA="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.9-beta.5_1541898369430_0.9942104334584365"},"_hasShrinkwrap":false},"3.0.10":{"name":"next-offline","version":"3.0.10","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"d7c2f178647065b3bae5287c602994294c2a9250","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.10","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-GUiZlpMWK9dw60Wq3Z66cLLlXYoMCPcxZb++gi8yiTkr67XKjbSVoLe2shwurXapXGt6ngNQ4d0hvxIGQshpsw==","shasum":"14d7e686bcb17f69e313781b9166cda9c272ad24","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.10.tgz","fileCount":20,"unpackedSize":358928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb54EdCRA9TVsSAnZWagAAX/UQAJQQ9Hg8z4FJ5+ne1fYz\nLp0mRRrELzeuceSU/DWC1YaK6EK1MmRym+agN7HDduWObIdzUICmtUgAWH4K\nT/cLrA8hdecMvheBPQPhQaMzoTKO0bFSwRHBvmHfI3AA6cjziwiVNftzSLOG\ng6x3UTQM5w+FhVOcWKyVXeERBb6CDKJ6G7NeFVnO34LmvUCy94920vLhr+vb\nzw3yV9+IjnVDVhdjoLE5xWmniia2LfL3diy1Mbu72jJiN21fTyNtvPIJxstv\nq1adjPdgKcybqQNYF59wtJL2Z/LAjQtC8CogooIMnpZqh16cJEO7O5xO2DwF\nG/8Rdmd1uPMAO308PQ9vD0JNEFx1JVNpDuUzziAhIL3XYGvNxRReIxa8z4Dq\nqoqF7BVgzzr5kbxE5FI/iTLqR5cT/2ru8gEh7HtUxWD8qzsvcZxCFNFFiy1d\nObyrRkNCi8Igta0baxryiDxkZaF+5K5nubPb93+3wnrgNaqnkoqKu5urHqKl\nS8hsbrdkJG3Wq2rLSAsDMktx+21QkrGo7UbIMa2n0L7HGjsmnr4ZaHOgUn4j\nmwmnlVAXKpGRmUgu96jC6K8dgEFwYsErvmAYoGC9kSofyHUGs9RwRLaijhzJ\nruid1Wsq+8c14TPzt0Svmtl0PnWlL6wIvw4087yzWYGdgY4OSC18jdqpZ58p\nntWW\r\n=iScF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCalQVTXja8MWdaUm8VFQv16jbg+yti3LeCow3R4JMK+QIhAIy/JQpL8bvPdRbPtNnzNUkFVxbktlwZdBkUWcFIK2Cq"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.10_1541898525075_0.8050465000785558"},"_hasShrinkwrap":false},"3.0.11-beta.0":{"name":"next-offline","version":"3.0.11-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{ urlPattern: /^https?.*/, handler: 'networkFirst' } // default cache strategy\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\nThis behavior can be disabled by passing in `dontAutoRegisterSw: true` to top level config object.\n\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"624c2bcacd8fa3ae37f4bb76b3a4368baae87521","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.0.11-beta.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-EAtr41msXQnXFEP6OBvRrvudUVycmSmPcVuwLaks06DAfyimOuUtszT5yg0PymRB9Cixqzur556/br2IuH53YA==","shasum":"da4f90847c14867833b8c9e76b48597d51f093c6","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.0.11-beta.0.tgz","fileCount":20,"unpackedSize":359497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7vV0CRA9TVsSAnZWagAAHgMP/jhudyej3tcxYyLW7jkO\nWTjZ2hUZ4dRYEzbur8/y+l00SyaCLi3j1RMzGUmcdWIY02NJdEChwpCLCoh1\nHnvQchSYFlU9e1mzZsH4J5EemG6cLvyq/9ekeWYmJ4fCJfjhlZ7xHDW2XFi0\nEkHpEXzQPe519D0CFx2S7rytxskzcDlFyYm5YX/U2Bi6hzz6of2U/z0ca1cn\n9+nMwKINwF9MpyDqV6ESQR0eAcjfllT1C2xNGM0TCy0o9tNHq+PRI4jJ2tUe\nXhwvANb1Kdbfzdrl10AAH60Z35vUN4oGdlpxZ4cKlHXjxu2xI5i0eFLef1nu\nAMmRrHS56JwxCd4yiKpGKoL2RrrvUJXRGjczdPjRnHot0yFyUbYnRORVNJM2\njetiPOmU/oo2CpiRMYZ/KpAcsHxjVjzPcanv/5rwbs4DrM0/bgSPrEFoP1fk\nTFf+Qbo971DF9jPwXEQDu0EX8OOLYGkYHaADM44wX3ntCEbv7U2UJO0P+iCa\nY4YuDO7f9nEbUEcswFCZCVID53hTok46dJ5nXpC+vCxHcDX9piWuPCdwy9qI\nLafJI/buyfAhXzth1HypF6AhY8CiuAtqQCAY1l6a/8pvkcKpJRr4wCf/CRG5\n/aeM8797Yi4b64nuK4MWwPYrZGXpFKhtKQT3nZqETpFH+Uv4w0lxmjJHMqhy\nL2Z9\r\n=iDmU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH1ONYBvikLMs1ZLZobUzF5RoL79eyHTjCmI5InwEc+CAiEAoOJhJKpweiphJN500+pL44JEd6Y9jbOAVw69zxiXk/w="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.0.11-beta.0_1542387060047_0.764356361654138"},"_hasShrinkwrap":false},"3.1.0":{"name":"next-offline","version":"3.1.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"b3a4508d5f32039ecfedab11f937335c8b6d7935","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.1.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-jOkLlp353n2jegB5S2WmsoJNTzDpBF8GtvTvl+hWNh3D0hsIvYvvgSOfJOkBfFYy9uKlz7+udux2eEIYphVYwQ==","shasum":"ff9ef847764b5d6fdf97b13aecbf11caa07e07e4","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.1.0.tgz","fileCount":20,"unpackedSize":360097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7vixCRA9TVsSAnZWagAApagP/j5F6FsmIdUdTH0zbuns\njLEgbttSNHkZMQroPYiLBJsPGyP4igRrJ5JNDOehnZOA1Q80j3ml6SD+W6jB\nevOf5sUEuXMCLYJK0RK3zPbHxgG1ti930D7NlGedKEHW6s6Ke/yEz9p6iwlT\nV0gNo1OMwYLVs7uKG5NVcjJ+BXdW6wcXlSnN7A+oXdJOlEReORXGpEUK3W7P\n+26g6F/88PDxe9A7HOf+aqnnqmM/vXHjHdjGhzTDujCHqSULd6cqccQWirat\nnC0NqRmV37J3F8xL/73LPvApB0lKCHraAUlvcig5OhznHfdAogUxrmQvVlxZ\nuVitvMyBIhV23XM6GRJzxvfSSR+tCZZgoeRvr0h0dVpLzRgXvzIgehoeMEq0\njYahVtXktaiMfGlbl0pSj/NxmQXcln3DvoHMP03BmGbnLlIJG7NEkDM7VBHv\nEo7tSF0a5ekQTolGY+WWDHKVKM8oHuSUzuwcpCHDaVPBugHo5AwdUpc2Db35\nQoGvVPBLV1ggkrf7jlRpkrRxGg7unvBmfQZBGDEq0mqQTlr1UPNBheNBLizb\nlXmAIyxEugPRwS2Lj4XkxrrnGF/ajFHsDYH+ltePlYnrSagm/PDzn9z6UWbb\n3aGDDFmVJ5m9bcoPRHYE/r1em4DVkRZQktFQVtP7jutWcQA3NtgsUKqEejI0\nGvX6\r\n=4jD9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGpqhRYTGvCb5wX7LUAXLVloTg032T9OYOInoLRPngfLAiA/rQ3r0Qz9NynSmjQJ+klokJheufT09IPHF94qnQ76bQ=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.1.0_1542387888454_0.7821131379713953"},"_hasShrinkwrap":false},"3.2.0-beta.0":{"name":"next-offline","version":"3.2.0-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{\n  globPatterns: ['static/**/*'],\n  globDirectory: '.',\n  { urlPattern: /^https?.*/, handler: 'networkFirst' }\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n### Compile time mode\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime mode\nAlternatively you can take control of the register/unregister process in your application code.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n\n  ..\n}\n```\n\n```js\n// next.config.js\nconst withOffline = require('next-offline)\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"d780115e77dcd3ce6d4ace1c2922e460a46e6f85","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.2.0-beta.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-T1CNfd63vVIdnBtsa6ZZwvZN4v1usdATImtGgZ7OZi+XI+KLzM4PI6uT69HZapFUe2xnuGXCI+8WRhwSUGpdaw==","shasum":"bff72588762488863093d5b67db5748f1afde11e","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.2.0-beta.0.tgz","fileCount":19,"unpackedSize":358066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8gTsCRA9TVsSAnZWagAAZfcP/0GsqwBdvQTDe2205j+P\nonbu4e1yfGDkC0dgsIC9KXOpdozNRRtxU2gvo2yrSs5bo0oyFGwfw6mimJbY\npByRE2Gcybxn2+xyVBtsJrc1wXXsr4GJB+iYd5uVrt2uKsSVQFneidMgtkXW\nSEagh7s33wTwBsJjgMYe9GR0Z3eLgUVygsHv4rVddkgXQiKOPivxpUY/L28V\nq7dj8OfuyrFxauAOOoAlG+4Ph6XT+pGaJu7oT+Ayn9GiPW74OsvZViOEER5q\nXHZ0oK2zJHUyW99t9YEmhjOaJj7pOXRcHE7m6IndqeJTc2TdrP3wDup4VqIH\nCKlLhSfAWZxONmuK2UvLJKTJrhyYhJgVIpy8dmhsmkF/cdExzInfGjbITyf5\n4a2jjeiuIARl+DjWcI5Lu7BYBJAsmS9/HeSY0NQR5G6NRaA423+kcauA40ZE\nTkAKS0g58uLixHWfWFyaAuBfknE30WhhWCbOQjk1uv2+ppx/pqeJ83PRBs/h\nYTyavg7rXMPyNlu/6a0rgB+7TvyN+EIeYVbMxKcE7akTWjzCQ/A+FM9wYpo2\nqAqxGOLw6HS3G6VesKpSPj7LZHMVmPI6FLAv/Pwttv12l8XiR3lH2jpY6HaC\nRd/CkGLHa4BXw2U35NpoEOfNSkVicSGwGRJoy1zU33mDzh2ccy7+bPngxt0h\n1pAz\r\n=IQx1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtC3+9RmqWZqQbiXx13n7D+6zl3MVz0jOdb3NbtiVOiAiEA3/8ZuhR4qSxrRnZcFGCegeNyUjcG/YGF2ddxlDnMpZ8="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.2.0-beta.0_1542587628179_0.3434593803085597"},"_hasShrinkwrap":false},"3.2.0-beta.1":{"name":"next-offline","version":"3.2.0-beta.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<p align=\"center\">\n  <strong>📶 next-offline</strong>\n</p>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline()\n```\n\nThen create a `server.js`, because we'll need to serve out service worker.\n\n```js\n// server.js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## Options\n\nIf you want to customize your generated service worker, define a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin)\n\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{\n  globPatterns: ['static/**/*'],\n  globDirectory: '.',\n  { urlPattern: /^https?.*/, handler: 'networkFirst' }\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n### Compile time mode\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime mode\nAlternative to compile time, you can take control of registering/unregistering in your application code by importing `next-offline/runtime`\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline)\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"a992172a3778c687803877bd8aca3d67f5bd59eb","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.2.0-beta.1","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-p2+wV9CI8Ch5mM76WS2i51BP+Ok0NtI8sfjz41LlHmralZk8LEvCH9eI0qdJdCIgczr5/JcOePkSmyaVPINYDg==","shasum":"eed0976c6ac1f86cd27726a6b91025a119b56ab6","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.2.0-beta.1.tgz","fileCount":19,"unpackedSize":357645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8ijcCRA9TVsSAnZWagAAzroQAKLkk+LQ8mgNDW6se8Fr\nW5h49dQBLkxUo1kIVej7dWdb/n4s+V/yYmn1zyHcvZRZjPqY1k2n/naZbGf3\nHfqJUVBW+D7ag+5yCUNdxulvJxlw+jJfvYpVuyVLp2WmzqoZTffrugVxzTvv\nKVsqpOxW6TyMZJeGum2eTOlZzg5MVd4tyHZ7JQF0Co1yMyoUTk68lgn2PZJf\n/xoT/zQZhCiOApucSP5qSDYeszH6v9aJeqnolyqq2npiYl2v/cvQihJD8Iks\nseepQEMDktw1WbknEVYOgRd8E+ETOulvqGa38itj5fEU/X+QFWXgNwtaK7jN\njPif5pb6t5JM7XjtaVjH5AZvk26lQYqfdBR+FA4hcvZoecbNu6LgPoVBDPDg\nELG0L7CHjWL4Lk9gdtl5/D+FvzvBJZv8x53/gkQj5i8gSXZsmgZVA+LWlagt\nTIPErsLUFuP/ePWzDPu+PPhyEEQprDHy/M+z3/iUx5Q1dCgfFKDblUZwcgOn\nqwvOf5K8hRLasyGD424roHqU4WRM2gwm0JMoQ8AOOgPFO5i8Dl0WxV8Verow\nDXDpAHi8RW+6SJZKEfkCmhKIpFa1eWeatoCxJf3pplNpnnbYKqFeHeD6RbF1\nwZf8sWaIT/9dgsDFzXYvBFrXO6JnLWESwHvKpgPi5JePQ/ApCh+DTERuZa/i\n5a+q\r\n=aqNn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrEnFxTQwQCas5GplMzh0T9D3Z6ZKs+YM99srg5bBYbwIhANrPX3vS/cOqRF2BJsZBEUnj/XX/dhUejsbsisn+K8ca"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.2.0-beta.1_1542596827995_0.722428471757927"},"_hasShrinkwrap":false},"3.2.0":{"name":"next-offline","version":"3.2.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"7cdd0227ebcbbc26e8526a234b242431bc607e68","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.2.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-g7vnHo6PKQ26B1x5qHksJHWH36I0iAY7q6N7aUvzzaC/f4J3xUnEcYnxsVDVcjst9eNdRWXNoGV/oGK+QbjHBg==","shasum":"56bac038a0d32bed29afba29d4b41de2594cc913","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.2.0.tgz","fileCount":19,"unpackedSize":357638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8uv8CRA9TVsSAnZWagAAxxkP+gI2fXf/6xw9v6qUJiDa\nQhkEoBpUhw78p673/c2LtJR+ZaOlolB58Vk01CluRtcCqyOTvlvfAG3Hf648\ndtnacbut2H0XJ5k4RzORRI7PSR0nM+UF6WPl7UGGBeR/Sk5GZz/RJ9/1VfbN\n5rAF91Eun69aNF7F2NAIb7/qYB9ZjPAT/5i7nT7oNK/LfUD5e91tajzSqAS8\nEzyM5+W7aeSO0k6ohxbAAkMo3KwGzYx0sA0DrUSupqIvZj0U1w3+QAAlp+02\nlpCQQGA2D7Nln5vY2v+BucSAO7AQTrnPQlFRpLaSPjmP/Tt9PPPi6M6z/FUR\nns5pZFZWEw5aLXVHQggvcH5Y/jg3v0VFfixhP1w+aVVTyt9wCtT+SyuZa46I\nDimQpBGiLX0KghKTtA8LROHFv4e0yrQVBP5/QQiyFIpP8XnCzznN5Fz1ZEQa\nsL9WO3fX5F7Wpf6zejtnKXRrlj97EgP2ta3kngkFcn9n5u/7r1Z6Bc7idlsR\n3Kzn+EroJET+ApVbrb7cQSwMefAFrIBwJLBfs5N9KO3A40M+6P5PKUrN6TGl\njI+jB84dBkQYYr+4uLFp0zXUMtNvLN+b3ykQjM2LLgCsqcJaOpN4geX7FHLI\nG8WI+zUW52wqRAJn6vdC0py8KQlQVjACt05E12JKDzC+PBSOJy3XxFIreMgK\n+zRh\r\n=sxoZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTd7Tkas8SzYKZhxx4ml2IgBsl++MW821l1SgB7tZp7AiAMRA4nwgwRp6wJFhfRBmgEXW62bCkv3tGXp535xv/ILA=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.2.0_1542646779300_0.35206636470047736"},"_hasShrinkwrap":false},"3.2.1":{"name":"next-offline","version":"3.2.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"2f034c5f523c73d880e30d92f3d7d9bef5a3c80a","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.2.1","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-1aSA+AoK9nl6UXlyUVo7vCjjhGQ3uRWSqIPDw8XLsqmLHl2p3Br6IWZ1wPCVR9iahHIv9XRGSWcs/Rw6ycIslQ==","shasum":"60719fcf5317612b0e98489faa59ef84a428d8de","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.2.1.tgz","fileCount":19,"unpackedSize":357672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8u6XCRA9TVsSAnZWagAAvugP/RFwgwyhbLdmAo917dGP\nnzQVDlvUBtpWwFUrgkLau/81Jha0MQF1ogb6BV0fJMMyuAMHI+kE11eh9EpR\n2s2EeXox7mX+i2j+cb6LVyPgM64879uXgUVbSaObZzWibvMi0lqLnK/lSNbq\nD8C6CfcarQ1V5j2r2bgFkki6TNEEzc78jYdkV3z2IwvWcxS3vKoIRIoWo06h\nLmyIS+SBNN2PguUMaSNCr/gbQ+qc7gbfWnd6OSTF190eHO43DFz1Fx1rQL1f\nSAg9bxGN02GCsGCAnvo7qdT0k0GXjrLMgbbtMeg3SKAzl0NnRq5d8y79Zl/f\nbu8e2flVMZgApDr8Lhw955ao78kHp27Tcjc2PQOQnBKHFjpZMVn5LeaAHB3G\nQ63RRIgoBZrU5CnZLXpRX554ulOphUrBJgqrU+RMwrhXfMd0voS0+yz2Va4h\nR/X0Q+upKJI+N7T3MQ3VEksVMMfxvFi1vpcjV7kHQsKA7yexDDX+NqGt0N65\nM7H7T9QbLLoKD6I7fLeOzdAKRQUInoKvCmLEbOPMTc4dRuhhhNRjE9hZ2oJc\n9ShKdgfV+OxvvA8r1JaPWRXPri0O8ShX5NS+2UfGo7quvuprEpd62dyThdVG\nCvK5kmZwhqdmWZoFPkeW8HbSTM7ZFKoZL8xCM/7cgNarolFCRiUksgIhRBYX\nml3X\r\n=t+74\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrEhGXV4UDRwH4K7UIuhmOSYM5ar9cs9oN01nChpM5uAIgaxFa7kaZUfMmw6P5XsSk5Wd1SErLNt6os6jEA4KxTAs="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.2.1_1542647447426_0.4957848569246823"},"_hasShrinkwrap":false},"3.2.2":{"name":"next-offline","version":"3.2.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"c44e33aac871797e60b616f915aecc0107c33625","description":"<p align=\"center\">   <strong>📶 next-offline</strong> </p>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.2.2","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-RCobLztadsQWkpcgxvSDJXOcrQLnhPyCV/63mAmz7r9Tea4Ezjv7zq8HJ1EC3n3CCppcHMmONS+1H4TbA02ByQ==","shasum":"6ac416c98287120a296a6f681f083e99155c23b4","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.2.2.tgz","fileCount":22,"unpackedSize":363956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/CLuCRA9TVsSAnZWagAAo8QP/RzQAkbUPtMSWUQD1dlV\n6pkjT7nbYCLuKHiqpTpIcIW0ac7l697PX2RbA7Y1e16S/dzyAEH/M3JRemoP\nh4Fwsz+xABbXb43fu51baMCXRBQMLk5r1oA8hP9XysrZkPi7HrBUc1EiUsq7\no4mjM/o7p41ZgPvA+/apa2c2wGfVS38Rg4BN17FBO84BNE9ao23gxUZ7Hbal\nUoS6avDv6uDkcnJ1GRTQqj1Co7HFsLZhHzdzCNaoWQlNCSq7A3IAIai0pYLz\nym4WfwaB3ttKX6VdVx+TkmDf1WLZNPIMk3hRkhAkpa91VuqXU4EiMFCQqb4H\n8gI3nKT08mpg36EzH8r8EPD7so2+TmGTFjV4UnVbLOjpOBXjG9O5iGFMhVae\nPl16gGN0Su1cW9WGGs02Q68QKzQtj0dzQ8xpYQVKNObsFvtQo5t0oyVEYKLj\n53LBznIvUN9Pr5LzwLlDAsHWiXLK+P4DEoTjIggJYxtWjaTuzoR+js9Kbogz\nrZ1JQcqLmbHZlzZN0hDwU5Ikl5eCqrn+gijye3vIx+aPSW68PV4dGLT7afRp\nAWO3b6yM/fErp4LHbrWXKEBbrryewSHkJx+MgFrnvLQe/fjAzIrTiTBniiuz\nvhW+2T9AifiYJ29ysc3RUCakS3GSnphcwIlokC+9VF2WOC+O1/XhhUuVTidJ\nLxUe\r\n=aEcA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIArGDv4CsR5BFiaiHrb4KeSFj9GgefMJYwQwc1KQCzCWAiAFzeNv54IteQTSjT5NzAHcVVdiotuzu4SByMNaIXTmvw=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.2.2_1543250669621_0.774615265873472"},"_hasShrinkwrap":false},"3.3.0-beta.0":{"name":"next-offline","version":"3.3.0-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0](#now-1.0)\n  - [Now 2.0](#now-2.0)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Cache Strategies](#cache-strategies)\n- [Customizing service worker](#customizing-service-worker)\n  - [workboxOpts](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Development mode](#development-mode)\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/examples/now2).\n\nThe changes to be aware of are in the [now.json](https://github.com/hanford/next-offline-now2)\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js').then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js</td>\n      <td>false</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{\n  globPatterns: ['static/**/*'],\n  globDirectory: '.',\n  runtimeCaching: { urlPattern: /^https?.*/, handler: 'networkFirst' }\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n### Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\n\n#### next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"f9b55b81c759036ed3af47503c54e3d96b8283d4","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.0-beta.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-6qz3Qcxra2GzahvhCNjpvm6VTQxE4nui9IcBj/ROtS5j08zu070aP9aBaTNEVNm5OzZ/cDobdLEnpWJ0LRXMEQ==","shasum":"9eec746ed2e69e30f9f80419a223ffeb58ff963c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.0-beta.0.tgz","fileCount":37,"unpackedSize":730536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCrVrCRA9TVsSAnZWagAA9iUP/24JYgM3wYqzNHc5QDBE\niwWzjZ9hOCKEK48tyPeCUV31HvrvUdmmxCmF+f28INULEQB7ECTwBKNrKJfm\nJbkzZfHdMmvAuN3Mcg7Py8YcJWmIl+Ww46d7RMywJIUwA518zV0QVS6TiB3c\nJEj096Ko5fdx3dcEnFJYnuWtXqIlfOeQsHfDuguThgrkOZBguH8BmFF8j3dp\n9DILPvYH2ocQdEtoUY5TxNDrVpjM2/eMZwKfF16nMGF3BJBJfM+toMZe2+JE\n9goLqdaxO1AFK0NOOksWzzf4YeWYdxTjSwQfd5ptQNQrXpxHLqvvzH2d02qe\nEtzvCXI8f81d1ibwSuwB3bEOy1W9mLDTJl6P6AKhw4NKEU4g6VJOeHUXrMEd\nWttWUVu3VOjNNxWvheTprVNdbLJ58S11Roe2cx2rphSghT5YidkcCfZJRD08\naNWkY5Cje6H9ixAlNjSUTWVtaGpq0fDiaV+lr8k9t3TGF51v/rdWbLdTNkqe\npiyOo3Mxg7lUblvuOxWxOUMxKTSK75FLCu+KoJs0ENDBPCJYKKgeg6Hz4NsY\nwienTtH896M0EovJZUtBNfxpHgKHpHCwt9dFjOMN6cEg6XWASKRi/SxNPwJc\nRQkeAgU9f36GKO6GT/30dPdSlc0KzImvtFOyZozDZEHWfj8Zmk4UU8f+q/Sx\nhxkz\r\n=glK4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrma6X6W7XH7DjGnPcZmjRSQTf21hq0+zu4Sy20/txbgIhAIP57Xujr3dnpGaOUpAGmq4J63vtQo3fpMINWk4gpBre"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.0-beta.0_1544205674860_0.6766269688595414"},"_hasShrinkwrap":false},"3.3.0":{"name":"next-offline","version":"3.3.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"3624a0b3dc0c8d6e3e8679007a43582456378472","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-qYfxdDsKxtRe/MjWtboIiRba0xFd2VjQj4V1DBy3px6Dje6/p6dka9ZyGjHltdzdA6QYjpeLGek2+E4nn50SPQ==","shasum":"c2f5fb5ac90a6b76485c576eed0faa5eba107660","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.0.tgz","fileCount":37,"unpackedSize":731168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDZ/JCRA9TVsSAnZWagAArxYP/0Q6YnC9YrhIJYrNp0cU\nCgP5X/d3ACEInj1cy5dFjQPo7Oj4Y7xG0gLs+ngPSJheFszwktTdOXdfOZQN\nQ4a3qxHcF1VozCQHra8nQKhfv8La60Ue8kZRpIcZfr77CU5888gJPzsqh25H\nqKFox/TOIitIvBZRCuHufCkAFNjGf8frVLL8C3SH+NrB7vZx2NeEUyDGcfVR\n3jITDZWOt51ulV/+x2BF4/b+OAMXj7CDBpovQLr3dcxI6Oo9w3O5grebT254\nTJi6HAI0U6l2VSMnxOBX/VJfJM1cdja0VS9qbL+t/RoEumOnBNNApb/LkKPw\nfnSeL1G0M12JdScbWcv3d/9I9bAxfZN7tnHbL9hrxvAxWnbLd0e2wwV5mqXr\nqooKQcoTsGF21pzzEh/BCaAQEAOcn5aUkiG8zQEQGxyZ5TIDgsEbFScT+U5Q\nK0b7AneBQLnLH/zDtuX4LTq09QmGTGE9Or/KGPFS1+d7nHdVK3Xz7K3C0SHo\nSc/uwbm2qOxgBkjFcN53WrUahx3DDW1qqwo+p+2iIZaxLA0KUk0TtjHU7Eq1\nV0Gl1jIYG2S0UUitDIQJPlm15XqgcbAWok7KbNtITFad0EBC7kNX3lc+9z/s\nDeSIi4XUXfrq+RmtjTctgDNoP7U74LD/jYRU6CGnudg4BGdoy4R+kdTOPpKJ\njKRv\r\n=Sv1G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpeFhqbXyWTkOOIVK6uOavVzpQ5LA1y2HSToxJT1Y0XgIhAIC+PuSOqHrq6BPL5ML63cpYGwCawwGnk+8LHH1yx8S4"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.0_1544396744555_0.8651796600690984"},"_hasShrinkwrap":false},"3.3.1":{"name":"next-offline","version":"3.3.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"2e208bb446e58c8078d63091acc374d57b51d4e1","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.1","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-nIg90zb8l9OfYK2sJxwqIvfo819rXKysn8JjhAfny9LsV612RHE6AE5P4MkptFeMBfZa3QqnwPkI8KynMBNNyw==","shasum":"8f854f3bb1e7ebbc380069af29b414c0ca8f5ee3","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.1.tgz","fileCount":38,"unpackedSize":731973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEU51CRA9TVsSAnZWagAAFK4QAJeAaKu1y5nyLDWVpq+h\noIEGg0KC8utxQXJqya0QBcMAxL6dnCi+5EdA976pb2MxsKJGEVLZYoevrGWJ\nrP/qEGs1H2F3SPwxDhrBwMYs67fh1f2CCsu4Kvad835B8AiTqs7cpdKTqTYk\n40TU2dJ81u4cTlCogvQgGhqWCft6pFeoYfq9KjN15fKB+JBTVxk5AJtLvyKy\nLvVDdUjmIDVQONKoDqWWFmCApAh0g+L31fKKH/yr3Bp9Ott/UcVR5C5Tv/NM\nkjcej4qnQaZ50eFaaaWY9gQG8BE0Vf7XxavRI9lBdZ6PO0BKEasp4n5qvrH8\nl5wWX7qfiH58q80c0Ccy+NWU4imIdHe74S002XN77A9t8NCAdTC9wnORoPsU\n3wClI0OFxozuuUufppKdNlVRCkTz3W+2N+EPYwLsIcGtw72ziExB8PoeIpDi\nWHyTzXk87b+T3XETOgeWaObb719n3zQajA6Sf6uxodrIQbW3M2uiDW3BraWA\nmGvwPsOXzLDeIPVcLwDjp/HHtTSjhQUFTgE3HL52o5GOAfW4MxAfZoGkQDNE\n34Xil92lRCkBHK5j7ERz/vX5Q+ZDI+Ll0wH/PIdIx8tuCIFObu0rrr557hxv\nu5he88F3aNCfJulJhC5irEZEhKkt1Scd0dpMS3iIeiKbYYOT9GDtHxz5ucpk\nBXXO\r\n=jf4e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8ue6sYQAXRFCOXT7iNHWvBx3Un3IsIi5db/FTeyhY2QIhAI3StgnTF2/dKSc4lSneglvuxIfW3lR+hYM70SMcCD0I"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.1_1544638068645_0.3271817681127793"},"_hasShrinkwrap":false},"3.3.2":{"name":"next-offline","version":"3.3.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"808ce358fd73419089434385b3b90dc338c489c7","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.2","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-SRl/BHGRUd2kjCQGXG4AI6XoqaT3RT7tjRZ1wclFDVzUbpXyUJawVy/RILfJiKZxxUuPx74d4lIVYoYez+5aTQ==","shasum":"2e5b43af039986c40adbbffc84fbc8af1c43364f","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.2.tgz","fileCount":38,"unpackedSize":731972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMT81CRA9TVsSAnZWagAAc4wQAICcmW9W+5OfWLmxWeP5\nA6TF4O4WlrbhpzthKXzrtP6hL6yJFAGBP6t/ple+q4IWVYNxzCdB3FPz9pQf\nh3IH2fdi5lTaW1mcWU8ywFK0roy3ATiJ0+/tefPbxhxXgAETwNavw1ESE7jk\ngtwTlGxstefo4I7IfU3CSKAjl5iO8jUVxGc1noz0OYRKbMACYdda3oKZgNWB\nMCj1z8lRmK55Loi1jA66pYUJzt+EGCtjCtyXc4tTprG9USBw+FdQlyOp8Wzk\nb0sdsRH03/egImTjBG6Fy5ck/2GAuD+7Z0qK9nLQUrrJ5ck2iONmADoVB7Tr\nF27zw/5vL+hTc/SUZ6H0H52zCdbAnOgdx10Asv1X+zGcVCmGMyE11jmKURPY\njlxpjfJBPmqNEwBVgNXt2J4Qk13DN+qmCvQFbAsgxpLArMzlTpsbGFYInnpG\n/QL32IMeIIzCRmyJAEk8bXcpt8qzTxUdO5eCE/jVdTqCHq+fZJYszXGptoaA\n2HH7ea5g+8GAEC97yxcPQuSpKaMy+4GQo4pFPpWm38CnrIPry76nf1ss39Xb\n6rDA6UkCsjl3SjmG9BBE8yrJYwHvx1XWeHNtgbc6E14nwPNWmmHC1+una1Ne\njM+RnAP7+ceBkZ3g4gURcGoxWKZd2dVbNVhO+BCJWl8nuk3bud0CN5vu30sQ\nlxPZ\r\n=3rzY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICk5VQAHuCk4v/+KfnxkzF5W8LjEIPj8XNCLrLw53tnjAiEAuWAQ/urrxvp78X2aWfpD4cAQtiSM03TtuXTFo615/jE="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.2_1546731317027_0.7579403836217524"},"_hasShrinkwrap":false},"3.3.3":{"name":"next-offline","version":"3.3.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"1a41686e8970a08faf553b5d564ead44737f73d1","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.3","_nodeVersion":"9.11.2","_npmVersion":"6.6.0-next.1","dist":{"integrity":"sha512-Y9aOFL8rYmJpExt6Qu2brZQowmWjtKXOj411GIvnEHIHGBBngHdATxdDMa/Gx8Pc/UyfbVXhr/7TVrzc1IeurQ==","shasum":"51e13bcde88c2286822df4bbfaf0dbd4716ad817","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.3.tgz","fileCount":38,"unpackedSize":732032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcONdyCRA9TVsSAnZWagAA+swP/i2J2fR8XphL+vOhhdVh\ne/f0LRNarK/g6B5B7mRh8E0DFxBh/rhc5BNA62f/mxjkRAPvI9qO8ODCH/i4\nAtVoPS7yLI4aJbRRR7FhiAQwGgbAeP08qpPFHx7xaZVojqnSQPP3XlqThBlO\nudYS+HQsO1Iy3ts24JSPa743Nz/zJQik6CvKpl8R9gGaDIArlOFwNBKgbkWV\nicxc2/7BsEALlGp9SbAW7fz3RS2cO9ds/Te1u4VZ5petSVCASeEyuWUHymax\n1aQjLTnsfiDLsxHRw2oJ95aHNUlBx0HkNEAFzxAf0birg9Vj0pf22CkXKdKL\nKgbk6bCR2rTYr5M7PATQNiyMZpm1DOCS/tHVe61oeUUjN781iXIJk1qXrP97\nSWicqAEj8z11XugusbjuO0yLb8XK+uK+rO5oW+fCw7Xpuokkj9M6NzQaYu3F\ns3u13aZYXRCUHrjaQlq56LKF4DeFomfzzNfwlKI/8blRYbWkilOh1nBlzXbG\n7RLiZT/8Hqn+QfbQWT4SoS94Ue9JwRfynNoB07/2PuEGZ+V4dLL1vHena7Gj\n88IWme1ERUcQu4/rp/vvN7HOxNMYvglUDL2YbDKDHiauTcDTOPWIlAxf2OZ/\n+32o92/TROvvpKRy/pb5d1ZN69RccteBl3lbD/OUiaRdP86W7AdS1Gkzn/Cw\nr0jC\r\n=CYN9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoGR81Hz2M0BpAyGnFfY/KILr0YU6f4gJGS6dCgZ14YQIhAL1UOSPATWWDIwHUHZFeIjkdqb9uK9FikQzs9gjUW5gD"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.3_1547229041972_0.9700832967865889"},"_hasShrinkwrap":false},"3.3.4":{"name":"next-offline","version":"3.3.4","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"f96e9e00f2e7402a9a5508f00f953e3adfddd3a0","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.4","_nodeVersion":"9.11.2","_npmVersion":"6.6.0-next.1","dist":{"integrity":"sha512-l4Tlxjz++8taH6wEvFwUEQoGoSzXMDXUO+xOrYWw/NHfmREvphB1pzAetEJACijLUrEPs+M5V3WaFS0JM0xOSQ==","shasum":"c23c2bc14eecc6ce5bdbbd236bd79bdbda72d476","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.4.tgz","fileCount":38,"unpackedSize":732149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQL5lCRA9TVsSAnZWagAAGdkP/1XS7nn0dKENveiUMvKM\nr+8pJ5zODKsFWfYUTqZBVm4Z1+1YZdJgwqG42SnnsLgXaycCxcLpM5u97A6z\n/0wkxq94H6B1ddG8VyUe+i8YmHo2+NA51ALRlRuuDExrsVNuo0SN5YUEqGyL\nU2ZP3JeE5krkKMKobMEn+D/luDe5tjQrNqKs76CZh22VwpEZMgD93qU2BhLv\ncCxbxxYp5GaRDJBODs6YWbzQfVst2MSfGNSSVbF92jlWyxC0K2px6STJrFr8\nXtnlHxR1x+bXjDrFqHZ3ystGCosenLmy2RAcx5ZJ/vlDrnJprzofUjKNnvp2\ngVP2rGVajFJCMfk4qN5ylrJG+iuPMhsonHLBZWDpNBFHIKxSEouwowtdTOCU\nHtIDv8i2UEw3Kwl+jbGsAimB3MuSKAxB3TS0IrbX7etLkgS/5LpbO+/jAnya\nCBiMQIBHWNp5t/e6fJv4I0Ux1uYiovI4xcgZ8aVmUsQsO790EYahDIydy06O\njQTN+Jve8OSHSvKdGA+eJRw/wvc8phPLtj/e3h7+SwF6ybP6vDIlDWkZd2YV\nJfO/a/Mr0NxazQBbp2kvWuGmVxwSHI3nD45fscBgLxCIb0rVFU4ZZphbWtd0\n6gNovspxM4ApynBlEqx2vw9pCvYWsP8Cnk4aHuDGZ8Z/9jOzrzkUWb0dBVeE\neqUC\r\n=H8+f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICHlsPs61EMNz1RbSY3NiL68hBNDiUZ1ZzZ+AaL4CzhiAiAboOnQOsP9GOYza0JzpwiPqrjYVErAXtyoUmFwxCAqZA=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.4_1547746916619_0.32749303111255745"},"_hasShrinkwrap":false},"3.3.5":{"name":"next-offline","version":"3.3.5","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"c614e54ecbf6a0fb2bb9599ad0c91f5116fecd12","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.5","_nodeVersion":"9.11.2","_npmVersion":"6.6.0-next.1","dist":{"integrity":"sha512-e6J838mppCpYMnbCvthoOSZNtAj9iFpJdVnCkuQTiIFU9IDP/GxKpjsixfP1UaTyHCmO2GzmyiYaglzFMPeVVQ==","shasum":"e4c3f33efb0c4f49f3e28abd513ccc3a8fc8080f","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.5.tgz","fileCount":38,"unpackedSize":732369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQgHvCRA9TVsSAnZWagAA2YwP/3uyL3sBEpGRwYi8Iptg\n17Hq1e+4Xx88Mwg/ILxCReHx30cNjKywFuwC+BQQCklpjaCIU4y/uA0mGZMZ\n1zhQvFAJcVpxZFRXX12b4/BZPlTJg3nrNW3SEnkIUYmkq7dhoqinA9RRz0DT\nrqeRhLSBidnAn+Vk648bIiYQow2R0IcVj4oRTHVUcnX9lFCMvnY1pYzWOYeu\n4JsblP1uafXPM0izVDVQjTRon/IOJNWLboLr5Q+ItF7/v+PeERcEfDtiF/dF\nbECsy/y6kd6cUKtif/YAqRNpT3bpRCpTPgQW1/Kpnsnt7zRKvGqBRjkvd/Xm\n/m6hILPjP9fVua97skN2RdGLVqqZ003wMVvJQJMX6AxWcovyR7EXQWfKFTqk\nKNF8KiXDNcu+qjF574d5J1ERE/9+fAmtR6x/R/MA/czbFZwbw0IRk4yGgf7J\ndhTzmKDWV7GZIb3iWkLIOEDtcisWI3A2xQb19VSW95MfGAru1hLk6kbXNz/t\n+5V0PJ8pdxYpF7lzpNkMqIfgamu8/mLU1WcyOGYE5ZoBeb48XTkJt0W+YHjV\ni27j91NAZCH03DW1i6mpM+xxXTysF7vxuAG6baJFGBgy8sKLQUMIeBluySji\ntZxdDwq5oFqiXkqp5Kd1plj/R+6LLNFJegOjRCdLlBRpImOJ+b+ppiWA/E+S\nrmru\r\n=1SRI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA8e5RyfbUa81lKdjuMVfKzpZ6mvEskmYTh9QGAaGvaqAiEA0SvYDm0S/H6KzO1c9fWPS5KTgBLz0XO94uU3ZWlZ3jw="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.5_1547829742658_0.6290839257138519"},"_hasShrinkwrap":false},"3.3.6-beta.0":{"name":"next-offline","version":"3.3.6-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [workboxOpts](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/examples/now2). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/examples/now2/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/examples/now2/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{\n  globPatterns: ['static/**/*'],\n  globDirectory: '.',\n  runtimeCaching: { urlPattern: /^https?.*/, handler: 'networkFirst' }\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"4bb4a12f60f370d4561f39f7b6ca4fd94ef0bd3a","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.6-beta.0","_nodeVersion":"9.11.2","_npmVersion":"6.8.0","dist":{"integrity":"sha512-lX+N9FKfm5asLGLrHvD3f1aA1fwcaRs3y+WKfStEsWK+PJLiLh9UFncHRXyv0ubEBZJ/AvZGLYCgym1EpIF7vA==","shasum":"a61b67e38e97aff6dc19de2ca75abc110b8b18c8","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.6-beta.0.tgz","fileCount":34,"unpackedSize":81204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceBpfCRA9TVsSAnZWagAA6rQP/0YtU/qLOijkX9Yd+7G9\n2ncRxChUQATixDAkANkeQJ8/63bMB+eoTj1jBpv6+pP+/klfRAf3ODYtPq5g\nr3+7pkOkmb7Q6dQtTVnL1TQcUZtP2f2xaQ+YB6s36TAaOzJKtQLsVb8iFD12\nupfNo7KtO+kPkDnRwTag/fB8jnvJyRLeGUY0hTfpppJR608sNH1/5XZJaylX\nmz1AKe5obi57889sNEabyEfeTWZ15Qo/hKQqqrIZOqBF+KIkkCA0gFQBb24T\nPzfSReEgwjMrraBJXhRw9eBBjmW0rL9uN2gJAEfgHQvDDE8Iv6fmwxJkJcPq\nK9a5oug0incyj4cWjc+tvPxNfZ3IEj3ztD0NhQFeXZpPkAEqSTWg0blVfZCf\nIJCS+0CgJtdSTE1ykegN+etI1DyEG1I9FrXCOU01OPk8xdtyB9VMtMxnykKn\nTTmKeQqYlvw6Pg0+yg2EshlZWebjxNEwzUQ+aRiy0t4PBaptCQ3n4RZDXXzs\n0fCFLZp56495J6kqE7/qEzya+EbpeigAdyMw/G2z5OCt0ikb16k5exPT5uy7\nbwEbUQjP8mVLFOUrVnnl5ROVssFdXkmjuS8z1aW2OXXWvegHXdZZ4H122b+m\nxru3hEyMRiKSeFMwVU9/jS3Y/5c1kOMzwa1aSxZQ01iK0wMW0P9piZ356sva\nQUM2\r\n=NA79\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOqib9ksBP2O7GZCyd5Xy5Ahnaf07AkqDPpNPgwgevpAIhAKGO9bEsVR6z66Rkj39GAJtXohh0bu6i6i8HhStdQSaq"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.6-beta.0_1551374942711_0.2191118570628856"},"_hasShrinkwrap":false},"3.3.6-beta.1":{"name":"next-offline","version":"3.3.6-beta.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [workboxOpts](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/examples/now2). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/examples/now2/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/examples/now2/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{\n  globPatterns: ['static/**/*'],\n  globDirectory: '.',\n  runtimeCaching: { urlPattern: /^https?.*/, handler: 'networkFirst' }\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"4bb4a12f60f370d4561f39f7b6ca4fd94ef0bd3a","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.6-beta.1","_nodeVersion":"9.11.2","_npmVersion":"6.8.0","dist":{"integrity":"sha512-LH6TAvUtL5FK/h6iBZMC4STFIT6Y7EhlstU2ORiJ809ao15JKUp9sUYPPXAJduY/gwPgb+ce2enL4UD7OOT6PQ==","shasum":"1c9abd2616d6bc2e022c319f762598ccf8ac99f8","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.6-beta.1.tgz","fileCount":34,"unpackedSize":81205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceBtCCRA9TVsSAnZWagAARsQP+wRPz6MAGjhqgJ+tE6kX\nvweaJK4qyjR8ljOfwBq7gAO/joVbgdGcGaC8xz3X64XvSOYg88wOIPcf7hnJ\ntpCfcFKNp1xHm1bnKozHBctw8B1/KLx3qeseGFNCMO1loaxk6k1hVOTTlQdH\nzGLfJlvdzJBLmsqE0fUtjqxfMfT7dZ888Tcj5JxqsU0FMWxPkPZOLYxJKUk1\npGqEuyrkYzNxfA/C+jTJUzAqb0ukzPsHpK+RqO1d4ooz1P2F67QUEg/0Rd9V\nP+81eOLfdyFGi6ffuEiso6ZbLvVBHhBcVPuz00UumFxLhUTlDWBGR2BUbpMu\nOKLe8sUbZhsU9GlPOy6KN4IVva6Oqsjxaz2AxlGQIHNKz9/YSf9O15sxhEiR\n259J4u5+uEbdUq2+FD4waGuUgrPnLQ7UmMBv1IYjP/V5ndyTRXrS/U1+5/4A\nyhj0AFIfaZpSoEyACBmOxmZAmw4m6PdDuuzZIlR2NtViR5W057jm6W4r6Cm7\n4ScRZjd4ICJbFLjeMaT01h7rR0fkFNLhiRjdDX1XDtcj+eiOEDoUmi3CkLZ2\nTwEiZuQWpD/sL3NxBffVzLAa3lKeEVUx/9eEJSBhfF+7q5YbE2ZuMTl5jBqZ\nfHpf3UL6drU5ocGqjKiJkYMxsXhH/+7P7KgChO5UGqcBEeaXbbY5Wi6Y4vk3\nDGuQ\r\n=l6Of\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGICNOA18RsFltCRhwENcuJrUj8P1SECO24ALsw07MFkAiEAqxF0yDMP5PhaBdl31C0zvKBMshkLqaoowcgXgrYLVLM="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.6-beta.1_1551375169384_0.09016276508374266"},"_hasShrinkwrap":false},"3.3.6":{"name":"next-offline","version":"3.3.6","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"374134f8f22221fa81af830359a9956581a9e106","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.6","_nodeVersion":"9.11.2","_npmVersion":"6.8.0","dist":{"integrity":"sha512-hBlGTaWqv9xJf3c4WqjAfb6jO3+Rdfw42p9PQeQlsnO8G0bCg7GUxFebKDcK/b4scFFgmnvp4UNPt1vyMbpQgw==","shasum":"3e35ad59d489c641a4d5745f5b06ce45faa53a42","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.6.tgz","fileCount":34,"unpackedSize":81310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceB18CRA9TVsSAnZWagAAksEP/AhtstNCuA9FFw0wQeaC\nrTg0Ht65GYsSRnwnn8JlE18S6n0JfwvYk3e6zVvWe5KGd4dKRAnjR9naBnXT\nJPX4cYiRlgwamEl4n9o/pktc0A5RzqvG8Mxpx7nvbSPJvTyXUKQIx561QHDm\n2joSPx+qP4P9Eih1yGz9AkRyDZ1BWecv/U9E/Kb/tyuLS4SvBgozDU4LUd29\nExVi9aZHqN0M6pFFmJtBL91JwZ2KyLsze7dFVyZbu/iHDEuOJ0+vNtMIByHb\nZPEZrEeCCBwAhR+HQimhIqp+1P9Cwr90JYp2aRyUqXDmA1iTqYXUAJFR8HF7\nof86h4woa7IB8SgXrKFDcUszbPXoLBtvAsp1illjXe1pPSrwHWcga89W/aeT\nw9ia58KQ5seA6F+3r9939/UOUNBpd/JodtOiCVNmzCmCGYKP3gafBxam/6Fe\nHes+6FvAU9nZxsK8uqjUWdnJFEZ2LAtGJqIY+zoJAdJKn18majQTRmc+l2Re\nfUIe92/r+5rP/THn8vpzTP9T+lEPXS5vw4AM4o+vyBynvSJhq29K1XBz3ZA/\nVAspX046Avakcybe3X0a60zmNzrVUNM5XqJ/RCsMgZ6orCBma9azGa2qoFX4\nW9na6CAeEfVVQNbzx+gRhXkAMIVjo0cxjgcMERzZ7NZP3i6/nr73GQ7UKv/Q\nVBqE\r\n=gU+7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE6fWY+RshA1uqqiDCHmUfk8+ZLxsixZuoCk9QE1EbLwAiBbP2PEw4ye0syIvs32/eq3Xr2/VUhNGZaaGyF4UjyXfg=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.6_1551375740358_0.20982060310374884"},"_hasShrinkwrap":false},"4.0.0-beta.0":{"name":"next-offline","version":"4.0.0-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd examples/tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.0.0"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [workboxOpts](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/examples/now2). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/examples/now2/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/examples/now2/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{\n  globPatterns: ['static/**/*'],\n  globDirectory: '.',\n  runtimeCaching: { urlPattern: /^https?.*/, handler: 'networkFirst' }\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"374134f8f22221fa81af830359a9956581a9e106","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.0-beta.0","_nodeVersion":"9.11.2","_npmVersion":"6.8.0","dist":{"integrity":"sha512-2IUyJd1EoQ6ebGx/FzSHgoHlm3rWb0zg9psSTgjhUs/S0cnjI6iTym7gQKpbUPTR4PkyUv6o2W8iu+FQWMzZ9Q==","shasum":"121c9d91033a4bd977ec79789833210e0de95770","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.0-beta.0.tgz","fileCount":35,"unpackedSize":620965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfb7bCRA9TVsSAnZWagAAe8UQAJOop1zIiA3y2cB05Oqx\nM8syg2vpG0ic0bcrggMgOBsIchw4bfQJLJ0zq6wlO2Ny+cSREbVsK3yqv5H3\ncU+mNQ4AqfsP/85X3oKMag+lUYteJbS5nA754wr6JniyH4hI2EJ0UC2e1vb0\neFl1a8zO7iueJ33N/+73THQXfIlX96FDAvqPAdvaoM+o4U/UUxAiuFufTqB1\nco5kiH52gF6aFeS10wvSsjNFuUrF5Rfzdln6FOicigNPcCrnzUTC+T0J/JG8\nTW5nwaMiFW9upoi4wEGTXoXwSq8bof75nTa3cT77RkIwlMn5gztiO5HTlqx3\nD5R+DqYSL6UDqQcQW75dsSKDDQzCxJHRaoIp7QeOfZMr53IQDLV3C8sxqqQx\nAWVSd6jRwrFsOOIvt/UoOZ/gxSWJdYoU8rL8hfEQcWNrpD5KlWgifeSapQ8k\nich1696ZnjjL1ysYayQA2a1DyRK2/O3+KW2nL7tTpCCDquHTmG6+skFiargC\nkpZFlL6Z81r/KKySHMsECkWQ2wGImUG+su2obnuDOXZAzLoJRRHOK7Zx+fL3\nIypOoyDvXoiYFbv9TmpCS08xTdgyBs1lMe78IVzd2rOV40SHkU5zRspAwErG\n5svWlHc4DjUmJ74pMIVYqMF1AAJn+fNjHEF8UoILnguqVeN2GE0FJKFM2H66\ngFkN\r\n=8nZi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHg4ncf6rQL/O49jmbe9GjhhNTLG/P4S1sjYcL4cKEHGAiAlGQ2i9r2tGA5rJbn8AcVuRABCaIRObai0j1Qc+zudtw=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.0-beta.0_1551744730403_0.2826663038369195"},"_hasShrinkwrap":false},"3.3.7":{"name":"next-offline","version":"3.3.7","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"e091ca091d7c3ee0bf104108776c9e33be16872d","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.7","_nodeVersion":"9.11.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Xsfs6Xnu4Vdt9cgDVGv79uMJzqczDEz5gk0lpFbADFNQl7TcZHXcRyUvYguVGxVB3QR13amAkbeVA+1j8iJt3w==","shasum":"99e57d61c70071ec3241567db574251c988605e8","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.7.tgz","fileCount":40,"unpackedSize":661692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJclQVrCRA9TVsSAnZWagAA9ckQAIw5t+Vh4+9HeOYoGjxe\nplyckXjZjQiokBgs7XrEOfCH1b+JUL73eFnKBmLBtjTxXPxX2EAa5bxciktu\n8Hsgj3WomZbsP2ngIP5kQT6i5GpZ3pSOaHah2WY6I85QGTUam4vIAwJVNTFi\nQ23OxFIEkiT2NCdviSwbeFSpe2aKMbtifF1zY+SMcjOBBs7K7BHGEFlkHWxZ\nQpWB6huNzOOZom5dCAmwoSNzMQGgJtwFOtbQwuft7rdNqHtAGzLmp7AlpuYV\nbVmzGFfc+68Zhjcy2/WZjSBe+6M3s6BV4XBFBgi9aU7I+pcIsmGg+4NjUcIf\nuVOh/O1MpuYEazjGTvQoMS630n4ga91LZFlUEfIz4UXCAshFYVzkfVWKY/dX\nPRFkWIY9QFvpI2VuR1TYUvwTPb7nJWiYw5+28irRhVk8kOpeZe/5wyyWIeg9\nxqJQkdgC1dF5cKX2V8C/4cjIN2wrm/tOAjiZtrwWe0dMR97+PDg1WY9P+nX7\naG9yniibw8JujD11N03aiA4yv8uV5hn7/o2CeH+NEM5qvz9IZ8Jjw01GyDIW\nyBzCfxXv/nAnw9c+8bP7kfRweMsPqNcdYPXGUkgBmklDLl8Z9ymQwUYwevTP\n/6NwDBypa8pB6IT3ajkOTyH7g4UAn3WIHJSJRPDVg3+3AuLIohQYcqxYiOj0\nQijq\r\n=TKKt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICDDI5mTyx41Vq2312Tiz8b8f3MZzytMBrMYN2QiOVV5AiEAsYL0djpCfGWH14c8/WtfoNXAAXgn86gKR1eBoDIRU/M="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.7_1553270122168_0.39790000506712486"},"_hasShrinkwrap":false},"3.3.8":{"name":"next-offline","version":"3.3.8","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"9e215c625149c3d7ff3284d51627a045b264f794","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.3.8","_nodeVersion":"9.11.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-GZp07L31CvyKmcZXrj/64SFaoOAXabKQOSEuJNy/okaA2YMZ9D6ghT44a+65de8zKpBageC5KSA903xI5lnQcw==","shasum":"c921b57257d53d56dbc833e4726dae26a2ac415f","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.3.8.tgz","fileCount":40,"unpackedSize":661781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcros4CRA9TVsSAnZWagAAkMoQAIQdtPQ7Wpj4AyU7wpYp\naOOq2lx2gzEwF9nOdlD+tra66GwJX+ymc+c9rE0KCCUMxJf3JJ5cFI5Ryd2C\ngKHGhu6ezTwNLX3M7PD3DjLRH9cZc8MnFoDdtYskGgjggHwtS37vS42YlDpK\nFQotTsRDEEB2qwgjHR4YVMEhfa3soO2PGBwNt6tA8kuROTMjKQgxVVV4ExR0\nmNw17XQ0P94jDUyOQgXUg7DZGOl6iPGpKU528trZ23i0NDyDor+W3uA+paBU\nEJj7o9nrPuQTg9qsrtz4wdEB+is23J45j5OZ3it+ebhUxajwqBYrCxcWaqiI\np9BkjKltjOxLKaLh1g5bZU9vBSdhAiBVZu0rHG8I7k1HN836dp9ZrbJsPkA+\ndTm3+9RzkFYJys4SxmiMEf8oRx6gQQ4xD0KigDlcfUpOuFsrgNnIeVE0l+Dv\nE4GwbMzoN0bRp/vRxpY3tDRwCKoPnAGVY4oesbK65eUbo3H0IjgSGswEQzCu\n4/0zbj+88nszNpDDYAfC6DJmuw1mHdQP9nD3RLxAB20j0hMulBz2C+yjYY0u\ndg43Vja77guq5FqzqPjXaB4jBLRZ8dx0ikkVvyGufNs9M7amd1R0a9dnb7dh\nI10qJUPu4q7yqdjhDqL/EybjqKkk1O/2BVObekh+R4GhSUJ0p2tKzxyFeBGP\nd1kM\r\n=iO0J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBxWR0lB/jVBNdHE7r7BZLT0dKNWrQkad/h/gSvNvWOwIgXVHeS/9FflN+kW52KKzGUy8uxQDZ+PT3ZQGPpDkJRxM="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.3.8_1554942775627_0.3065061537772267"},"_hasShrinkwrap":false},"3.4.0":{"name":"next-offline","version":"3.4.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"3.6.3"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"5ea02a0aa150c90cffec8cebe2e5fca6dd876bed","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@3.4.0","_nodeVersion":"9.11.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Mu9W6Of97YEgH0pfZEyNNvXqkyttc0NEez5NdovLociDfv8v6boRXchRe0uMQ4AA2wuYivx3wFCvcFSCeIW5Tw==","shasum":"ac10aaa2f8b2d919648c8a61b5ced7a96e251baa","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-3.4.0.tgz","fileCount":40,"unpackedSize":662551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0wVwCRA9TVsSAnZWagAA3l4P/008Yx33e/JHrg7iKcIQ\nZgKcgdRwsppuQJ47179cB+IcdnZfXeBZsgSA/KxazHOTWJp6/orbO24yuVGM\nvFCagxRPzmTI30G94wwFUSA6+apihhVP6eAUZFz/DLWgjiT2e1HxfH051n2L\ntrenP4zfbsvV3q0frRyCfhmm/e9dCUh/NUXi+NSSDAosBoOr1CoibvOdV+Jj\nJmA+7uAgTCEgyxq5MtXU3OrduV+RebyWiIpxfj0ysgXpbUDIBw3vcX/KkQla\neh1q/7Kg1fKjt338fHs4ESWrdJpyWse6vA+6cyq8DP8IeLM+KuaeMeMxnEhK\nDP3xoUWZoZVOacfqd+jVOGS1S/PgadyPbkrdETtXUhEjhSINBNXQaO1G3BHm\nPnsfO7qT7q7YMMQwxM/il0nfGvJ1c0rbexzLlrbGsv60uB1rz+jIhkhRswY4\na56bxIDPm874JUc0j9cARoouJVzdr2zD3OXh6OL0Ofpyi46vTTNRj+5mghkZ\nlcOPqe0Q0UFBumhXLYNN6TBwyAY6srwF0GUt0NUKtlSPO8eejgDEx6q2uxW5\nrzwJy64UnPsKAu7+6UnIE40nC0qi9hnEdTCt686qKZ7vAUcYM8eBnO2W5RJt\nh2/QsbBcOoTFBXc57YnIcc2ZKUGtusZBklOLrBrhDxXWuZUybHvgBzNcrgyv\nwHTD\r\n=dSuK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKuPRxcx56pF8EazraUcadb9ACzi92a3y1jR2alJW8TAiBCLUNpcn16DM38V0dnyA6YrnbAO2QbmysJ+wzZkvPerg=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_3.4.0_1557333358986_0.44036425646707533"},"_hasShrinkwrap":false},"4.0.0-beta.1":{"name":"next-offline","version":"4.0.0-beta.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.3.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [workboxOpts](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/examples/now2). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/examples/now2/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/examples/now2/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n    <tr>\n      <td>transformManifest</td>\n      <td>Function</td>\n      <td>This is passed the manifest, allowing you to customise the list of assets for the service worker to precache.</td>\n      <td>(manifest) => manifest</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`\n```js\n{\n  globPatterns: ['static/**/*'],\n  globDirectory: '.',\n  runtimeCaching: { urlPattern: /^https?.*/, handler: 'networkFirst' }\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'cacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'networkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"cfbbd7cb0f915c1c5d2aafa05b00d1f13973d4d3","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.0-beta.1","_nodeVersion":"9.11.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-qkG9OoO4pcYtGwD9ez/d2W8n+PHbfIep3FQrgIrm/kxvrZF1VVReA961XzPLXUvenrceyaUVF7QL3w8fjp8Qfw==","shasum":"f6c5f4d3b6e9f36a289167f9f8423d8f2562ac5c","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.0-beta.1.tgz","fileCount":41,"unpackedSize":1210310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc2g20CRA9TVsSAnZWagAAW2cP/0NUcM2SNTIznFTXokN/\n4qkHwdv88f0K1QyUM00MAcCbisPHiX8/BZql+BnFdXlMbXyt1IsV2yeb6GCN\nrUY5nJ6N0Jw4KLVUfDHjZyzKP/q+Hy/+/fv7NWtOsMLGesvmRrzdA+i02kZp\nf+6MZIAciJo9DJMq0gMuA4hwEgjCqnzcrUuNuP0Uh7+saR/DVJrd1t3DKlAQ\nbSM7c+Jxhpnh4p8TQUu9w6Amccd9/zq1IHcn6eNWjjbzKSwczi5lOel8j/ir\n3prWK+d5lbEotN5Oc3Au43CZrFODbFCtmCpBARxCJeXXJrOkrjeE/j/qMvot\n8j9i6Mae55reCeCoVb2Bl2bUQ3d3xslTK/jEWvZdAnrxBxqAAxaHNTEzq5sR\n/awh1L8U9tf1ayftxL1cHZGoLHWo7MbpCw/LTeBh6eB0cGuZVvmMl7mP9RHp\n9QQmWIQLneXT9Mi/3X+23ZVgLKjfw3cpsgDI4ZTLJKO4HAf6ZejwPQIrO4Xd\nxuhTjqU1JenIbQ76vSGU1BxoXmQPFZ4trDMISHPEYoeXd3lAgGZ8gXpwHdPP\n1PCRKYugmPKu5BxKSwreCO7V/GwOTljml6JGY9xjWLpq7iQJ2sustb2v2Ugu\n2mcYkBsuufoYv1KI8tlWJp3v1dtuP7+iyF+xOOP0tdkx/Ahbg+4lCaKWAKLo\nybdC\r\n=ZHZj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWMi02YBFROct08MNB17e5ZXDPzXVQzBzB2YS0rwPeYAiAZbnjlBsUvBHxjPRbeq6od3uU0HWmUF+MhAs3KwIddCg=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.0-beta.1_1557794227959_0.8316363152995456"},"_hasShrinkwrap":false},"4.0.0":{"name":"next-offline","version":"4.0.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.3.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"f563d3a49f735e8365dd98674a89e2675dd550a8","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.0","_nodeVersion":"9.11.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-318QVYuJS8Shv6j7zmSPg8bBb4pDmG5IbuLB+5KRHzpotyPy5IZ1m7HIFGwtzbfoB94g1EDCtspHTT1+HinZFQ==","shasum":"d94cfc8beea649c877ba9ef7880678c097d497f8","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.0.tgz","fileCount":41,"unpackedSize":1211415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc2t14CRA9TVsSAnZWagAA7nYP/Rf2JqX6hieQLbW4BbUi\nK03Hdf8IpteMTmum3l2EldqZ/M/Gjde6PPdOloIlgNBeyqmck+S8xQp/YOQ0\nGL7mjOVqdfrzYPVbQBwNqHECZJxYyXNiAb0f9ukx3rpeICEEynsEvCw3NxjT\nYmcZF/OCce+4/SCY8IpHh0NZwJcCRcr9COT08vn6tG9lLhZKnQb8OZJ8fIrO\npvkI0jom/qMFG1NdcqmPEHpW1TWivCO2EpRzVhD1ZqU0od+VYHhUIc/RYn22\nux/agyMrfXeNdMF0lfo8E+AJvjn9bFUqLCFXy3Vdum8sNR84d3/sAelWF9Nu\nSL+Roh/oV72DmcKudEupaXmxd2j4EMUfw7/A23nSEEI5dVigvUGx+AJZOghK\nFhdpxygl/LzIRSdYMuVp4auQ+0q3gXWsN++FqeZhFzmBKCFAmhd7rhY5rnGp\nT23p4mEW9lVVPAqDAPJA09QTjB9PxBKwOghUjrfTuJ56MohVznIIzV+viPKj\nPtHrtQ6ktoV72iFLL8Wc5cP5Z+Nf8jFvi+74oKtbLgZLjevl5dqxT30RVFAd\nLpjfpI0IH4XqZeXA2ToCRouYM0NcS+f1vnwH+JTojUhIUtkPDpdLgqTxmTH3\nbvD0jmZ5fHLJdFbDPZLIf6YNFpi6lUDdW66TUG6Afkf27HcaMijBUwR3Pgby\nMjX3\r\n=+aoJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUHQgr39rLmAbhT8IgZMJm0Udyp1AIXeIaubRaUhdpgQIhAN6IuUv2QQIGh9QtYVZHCZnpWzREN8aRYT8tEq/0doD9"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.0_1557847415620_0.4590577526235111"},"_hasShrinkwrap":false},"4.0.1":{"name":"next-offline","version":"4.0.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.3.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"bfd964aa5758bbf2adf0692c67cb6aa024eb5da1","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.1","_nodeVersion":"9.11.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-oUducKDSP0F255tLE1Lm87FozjiJkRzVcL/oGfxwuD/w7FabhdZYGlRtcO7IUTYwb7ePUyomA+C6ZI+O/i2/ZQ==","shasum":"654312f0d614ac92d73f7b27e7374ab7899f5c1e","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.1.tgz","fileCount":41,"unpackedSize":1211478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5DS4CRA9TVsSAnZWagAAX9wP/28R9ud6J49TNRhqihKW\nAFrHITI0x/cVEBQgdhXZfhZosRzWXJrE1WD8HQA9pQPt7K1gv0MquTYZMn7A\nLF4oVJXerE34OgDbEeSoKH0XcvNPJ92t1AdaSvSe2DJTUFspnfN2YxDpHrWD\npEYgDzTY1iCTRIsDIQ/p6UNZzWdv2kSaMwQI3sUkoLzODxIoBK22jlFvcYJE\n7rpQOvviljP9yVk+50057VZqKQM65TNgB9VXNJskmuQWSFeVCrcqviTa+f0O\n5sCgv8h4BW7p2lvsNt+KmxlNd3tZvwm24r9VvhNpLQus+Ban1YGAcuyPJkcs\neqOgmHjYa2owms3H8gJ9vFelQb9NGZDN2v4d0xQyig5jshn04Ni9NgMayvWA\nhhS7WMJq8hvwAwWBXxWAIpfVDOEe/+IqiBvXoWQGyjULrXdlvZ1v9tz6Orq/\n0BAKL/cMecWWUvt8/R2+pShkYhqR7VmMLpmd1oPYqGWkUJTKIBuxqIKdHuQ+\n0RppBOFyQ7R0LnO60uH2SsBnsuDx1+mTRCWzRL/Ajqn5uUcZ7/VyB4FaFDW8\nwFtM7Rqmo8+vb6l7h0jUerAc8hi4efagTm4HoqwaOAVri77dj8tbu+RErVVX\nnezwsDxnL06NhZKfr7aYVABFPrMd3yiew23sGicBdBhRcNH8YChb4kBoSEW7\nqafq\r\n=WlTA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDKHNQz8Jmj0zlH8wwqRVg844/x28VY7/+r6ouX6sS7qAiB9KmZ1OXrqY5cKqvB3c7DJUTHzag1uXVvzfyFUo3Qa3Q=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.1_1558459575929_0.521802940929734"},"_hasShrinkwrap":false},"4.0.2-beta.0":{"name":"next-offline","version":"4.0.2-beta.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.3.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 4.0](#next-offline-40)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/examples/now2). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/examples/now2/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/examples/now2/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n    <tr>\n      <td>transformManifest</td>\n      <td>Function</td>\n      <td>This is passed the manifest, allowing you to customise the list of assets for the service worker to precache.</td>\n      <td>(manifest) => manifest</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  globPatterns: ['static/**/*'],\n  globDirectory: '.',\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  globPatterns: ['app/static/**/*', 'any/other/fileglob/to/cache'],\n  globDirectory: '.',\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 4.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [workbox in 4.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core depedency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"c5e82c2085d531a4bc6f84a5f7eb9f4888564ee3","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.2-beta.0","_nodeVersion":"9.11.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-uuhNJhEFAQbbSvz5h3fBtry79zXTos3nx8kr7oTYsPG3aDRh5iFDxN1y/0rrod0OFY3USFYMIIKndT+PdGuAAA==","shasum":"7dc05a7f6f6867d2fa74ad0c2e7c19e077ac8b51","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.2-beta.0.tgz","fileCount":10,"unpackedSize":23868,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9T2WCRA9TVsSAnZWagAA92kP/3i5P2PsdlIoW2hZvxq8\nqVkhGjQE/iAJ+e4LyuTO10R4smuLHANXd7M2uc94BfoQyVEgwevme11jCKah\nlAr1vcY6pUzDG1KbMNRXHZvBTjVWa2I0nPM7Noau8fGnn7YxTVyLOsQ8rBtw\nuna3D9i4TAzsu53k/UbOlln/bvnwUWKGykrrQSCT24fud1shjgjy4utU+wnG\ntN4/yFsAd5QuUqmsMsXUODKDDWKgMFze0owio1KfRSlAz8dfwzs59uKVxGl6\n384ZoSXG6DkMk1S6zEUVKwJ6cB1/hyTnvcM/uCVT/p/gZBAp3dTMJUi3OQfr\nEsMKpryrMesHVyGzuauA4pgHBiFpS/7xJgwY8c52h0mFzawVh663DG93idPJ\ny8B89Tpg1+EPgBaMvTWGLAMXxBCfz+1SR2qn/CMu64bY2bhQYMYN08tDOIfs\nuxFJsuRSnLk7i2BMN5RlY0lQahwGy16VkAHSzeTjYhJTJyVi67Hf+5hIa4DQ\n5pbB1Fd+w0SAV2H2COgJA0auwMGDIPBuvMiWJxO3ybC/mnJFikhSN781/E+6\nReOm2o8a9zuZx9yG/b+G2RRNRF4hMHfyeDmVOH8hofGHCUQcaHikisYoC9Ls\nZzaAK5n/B4r8PM2KTEdnv2emzOpJQDwPWvLsjWxgpj2g474i9M2Eq8tzZkNO\nQJHh\r\n=SuNT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5J5aR1qADUVUTA5suoCtcQ2gzcT9my9/vPSbfBjb/OQIhAMF33LNC3+HGp53/phndSkf/QI5MknD89sUfcI5XLurl"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.2-beta.0_1559575957547_0.29880722703920437"},"_hasShrinkwrap":false},"4.0.2":{"name":"next-offline","version":"4.0.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.3.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"02c40e85a84ef1b8cd4c4d068132ac24b1893618","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.2","_nodeVersion":"9.11.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-FCpJGZ87Qf3OWZYKYn1XZeR1jjU/+50IDafoTxC5Ti02GxCzZaPIRZbcQWDlrYgAJrGEwWbPefQdQfWIn6B8CA==","shasum":"fd21890d016e64757016c5b821676988c6fc8c15","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.2.tgz","fileCount":10,"unpackedSize":23934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9T9DCRA9TVsSAnZWagAA1coQAITn5vJqRmIe5vnkzYwQ\n45nhLmZVaGyqIelfjmX37ts0j+t2K9wOQD/XQA8G+3ZhsZo19Kn9oRPRLaM2\n3VrWJ067XEebB0IrS/eRRHICySVgGQslIPm+Mq1+G0RJ0jfdzB+N23k5TY6H\niTHow/J2Qk1xRbyH5mxzRce3D+sB8/orocOffPNbW77Du104+GM3e6URhwm9\nPTVAZjWD3hf8L/DE5lVE6LqAZ3canACIRIvgAugBbm6K5ewiVjDYPUikG2US\nfyWNVgSVk6J7WAgD6WWCGf855A2Rz1kLpIVswDENQ9pQQJmqJO0FOgpJc6Xv\nfX/4HpBjhCe2N2Scj+h77hjavfNwoJEa/vXB93ZnPVFkrVeBq5IaWQvs2h6+\nWg+eyzd8G/Y2w1MkNU9Ctk+tT0g/mXzwBafsS3d1lPhW6FTZVfaY/Lj3/S6X\nT5avauSfTU3LP8PPAQomxlPO+2L+pIkYLVmw2KKVGEfKD7EaKyKTEHWGxQUC\nHZPoOIOVk8aJtDKMwdN3u+cAPKx4W26/BZqogcGCKtpWmCqnvx4uJcq1jW0G\nEqIllHk1Ai5OB1OK7mQrcQhURefbkfbdERsfvYwxdM/0O3IQXdWe1/7eIJR5\nqLwQjX+8y2adSMqv712pNyrm8cvk3kSS8uu4K3X3n7lopu2hHVB8RYBlFJT6\nCIHQ\r\n=8jF0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIApD36oUXd16pS57r+b0jslLiIhbUrG0668rx2/bkI9cAiEAogK4F1tVH+P1FBUgiAk9t/2ZH+SvmGNbueKNvl+undQ="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.2_1559576386673_0.2700084735175654"},"_hasShrinkwrap":false},"5.0.0-alpha.0":{"name":"next-offline","version":"5.0.0-alpha.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","webpack":"^4.19.1","workbox-webpack-plugin":"5.0.0-alpha.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 4.0](#next-offline-40)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/examples/now2). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/examples/now2/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/examples/now2/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"3b8abb8e7aee22e657016606f17a1bff26de3acb","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-alpha.0","_npmVersion":"5.6.0","_nodeVersion":"8.16.0","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-+JmF/7JGF0F0pARXbPFtSBPCZKNSSYKHH0wV1fSX27ucXf3OTMM9JK9zeMvDTzauz+xb0/E7JMOuYA5yuwzWUg==","shasum":"1801f396bdaaa18d95f3b948ad8edf3a66559210","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-alpha.0.tgz","fileCount":8,"unpackedSize":21649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdN05lCRA9TVsSAnZWagAAJdoP/ikoh+RPMr1cfbR/OsQw\nN0IjCQ0n9nb1PxsZNkShVecDvePy/iDWogZboe/t1hMuFmeRVN7dLCc1oZuS\ncSVr79r55yIxltJFdkfY5+mTGJEoFY5RNNkUL+bpyMD6Y6UTGbqLQJIRvrfp\nWl4FD6KCDfaEt1HYPDVAPjVx9z0d8GvmGFcrVh9IKc8VuNIn9xxX/Pc+GxzG\nDWeYNA8ryL1GzyXz784AZygc10cU1SBa7drBe4rrYawTv/uBd03rOA+CzHlh\nmPACJmrBJzaTVr33lOD3IQKrEdaxE9EjIyN3yLmYmf3JkFKNKm7yJqloYvQ3\nTE4s95GyGagBKwRVZ9fpxVQp995PbXA5pgxhzfgKx4g5typbPzn02c0Y/LVI\n9+v7OEHlmu9jsyBFdumYlm9To9izBMCeBgveVqHTrmCdGFxDOGqf9pLB69fY\nhWcQqNt92jVnzheut9Uz496b6aQUxt7Rw6aUi23Po9RSC4hMSdW0g4GwKsgO\n2RJVMtnFXH+6ZY7g4m5qEqNu4S0evPsFFqeAbX6mzDyyuFDQSEIUGpp9oRBy\n+E9n11gD3ELH2c5UM31cU/B8RHnqkuCrQmqGjbj6wlBr4wCFcHVNKH1qOusA\n+quGjIe505c8iaKOE6s6RjFOFjdwsARt4N3yHR8Xd4Mt8AItgpSJZqqdLsSt\nNBdw\r\n=0CAo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeOgcx7HfKA5IZWv2L5HEv2pxXmbLdefphRH5SNlur9AIhAN1Ahv06PSOwDTtzpe8x9aUlGzD4nShqvqYz5VBR6rrP"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-alpha.0_1563905636875_0.08770818132767277"},"_hasShrinkwrap":false},"5.0.0-beta.1":{"name":"next-offline","version":"5.0.0-beta.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","webpack":"^4.19.1","workbox-webpack-plugin":"5.0.0-alpha.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 4.0](#next-offline-40)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/examples/now2). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/examples/now2/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/examples/now2/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","gitHead":"b120a4cec41dc33828f5d0dbb05121be1a2db81b","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.1","_npmVersion":"5.6.0","_nodeVersion":"8.16.0","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-nEZuI1k9xNV4gAmObK1t7GolYSP1iJV+HKKBy/rkSGs2O1G0w9ZegzQIceD/sKyqtWD0e0e/PUXKxLtHSV0chQ==","shasum":"3c17a88c90344eb4a8a0b33eb802c3dd9b0c33ce","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.1.tgz","fileCount":8,"unpackedSize":21702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOKVOCRA9TVsSAnZWagAAKI4P/iewGaxs2DaQVLYC91i7\nzYa09q3QhKRh5iBH1RWJ7sro7o5ReyUXfYIBj8R++ihEL0c3q5uU5GRjOnUG\nXjAGWGEBXNovo4KuOnZhRaYLbI4ItFMpJFpMJk4KHgwyvRWdnl5BaY03NwRI\n717e1PnxQBR4JhLw4KPlT+iXsqEqLe70wGszISGsrleNt0WXTXl6g5d9qz+w\noYzHY6NjT+EvZ3wZxku0YtC9zgDM07qs8Y5iSY42VS7CnliZuLzgWugojp9O\nQSS9ngs7wzYzaOXyF3sNLPpibIpRW7kj1v71xlfM7o9cIl6vRp5RPvYfU2wv\n9xEKWWuZB6Qca2iLMvnj7Cl44z2YeYzGseXxhbe36uw4l88y7h8sJJi3/95l\n3adYjdoy4jFCBZJUXYvRN7zC8sydTleJ4L48EECuqKuBGMsUfEtpA4TdpES5\nRamJIQie4q0iYKBZ4NTiV2SACUokrfeuPv58lmGFRa3oSJaySQ3g3CL+wC0s\nR6n0wTL/f9/oczazHeHIuxdMvP6i+JUo/2wkkWSVaDmQNnBZMYX09wLsy2Fn\nseUFdVcBpBZ2JGnj63A4MbgGGRW559EjyMpHAMRM/bxwtbE0cuDN3rmJwDDI\n+1k2VhYE9biaMb73tz04mdUBeGEhi9uM+jgST3fD6CF2J32lF6syEjHqBptl\nGMy6\r\n=/dn2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeuLU/bnWxskOdtRoSVr258sDXoA///snx/HoP4zaJagIhAMdun3JLtCTdGN+1G+LLkNSMESBeiCl83Jkhc0EU/pgP"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.1_1563993420886_0.46832590623245385"},"_hasShrinkwrap":false},"4.0.3":{"name":"next-offline","version":"4.0.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.3.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"0b07132df38e51865cf5296a38ed338b5a7b889b","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.16.0","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-GlZsoUxJJEIRY8P73L5Y4qdr5ST9ouNfYU3lg/6oOgZiDnBOuWyQpKf3/E3AoVoABQ4mbP0QOq+1ecgyMkxcjA==","shasum":"a6af7443cf8822a1d4c6d6701563c20fb2b44f49","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.3.tgz","fileCount":10,"unpackedSize":24512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQbYrCRA9TVsSAnZWagAAOD0P/2DkIb1NLHVGOXBB3b7w\nec4RrYFwgWY9FxEV6K41e0on26jvlmfUEOCXS3avCL6ZEfx6IeW8Qhj6TIet\nbKrb0+eungATVsL17oBmp1IfYEykyVRx9iv8NVIHO73YqBYxfd67hQMj8Zmf\nvJnukjq6j2AqNHgwB8NG8XSxOAPUeKG30+UD4mMZSnElPDeEHFXKg8jtYET4\nvxhqUxE0aLRfZ54aHOp2eFWd0rtCpqr8d1usTaxSRWFoVjuBW6DCtkUFc8Ok\n5RxQi9a9E2Ocu6JDtapthqKMtovv9gQsg69Hhglz/LqgPLnBZdClvCGxE5Vt\ncAU+9znn/6U5nB8bikpiOOcerpzFr7gPAfq1WoEtaBvNLvFH/X+NkBIcTLBK\n1K/BrOQf1AVCeJ8NdqfiEOy89ZnSngmi2azVhOlVsvKesYEziKdcQF5G29Ru\nf2htTDP8wdD/xIbBkOm6dheN/s2zgDF4UdQ+e5RSQo5+GQc0Rz2DfiMYruqM\nC0/Jmo+Gn1Bh2YT53YFkoWpy/i65WjgHc+gmoxa1RTgpml6SfYvmhkHS0OQT\n9wWWt47rB0y2WzZwxsQK6lqwUkwojqTkazPbWAF5Y+qiONA94NgDuNwMFH8/\nbjBjxO66PYRDhwAEDQwg0ITwfgkUT2l/bvYNI2zbof+FEH0X65F31Xiwtut/\nfIoX\r\n=k0gF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQPBjRkNwDfb1GviR/pZJe3qyRRT4dZbNR38KygODDTgIgIaPfilq1YiesAFU/tJxMIW9eWFoCW6raAypDtTIJCeM="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.3_1564587562635_0.15004028271463343"},"_hasShrinkwrap":false},"5.0.0-beta.2":{"name":"next-offline","version":"5.0.0-beta.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","workbox-webpack-plugin":"5.0.0-alpha.2"},"readme":"ERROR: No README data found!","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.2","_npmVersion":"5.6.0","_nodeVersion":"8.16.0","_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"dist":{"integrity":"sha512-+YxtxLRT10QfCwUBr+fdJHg6Gt0cG3p1gA120Pp0A2wEHWpF3+tV7n+nbPAVfzr7OnSSSIWTPokOvHSdm69dHg==","shasum":"0fdcad15e5601c6cb526630684ef152380f263db","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.2.tgz","fileCount":6,"unpackedSize":6871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdR5jACRA9TVsSAnZWagAA+40P/09fnZRmhELGnKlfAopw\ndh6xImm0QeQhZDUxEW+zpYBdM5bd6M8Z0k6VdsSK00xij88ko4RUrbV7y+EB\nWfK2WUr7CSKnVv0GhPV/slQnICm5XqmHL7/c4xAsXqBmkXW+M8mX45GleY/j\nIouSYxDL4iR4Fe5OWg4QhqlgDHh7GtTiviNh7WN+QDpoIP+yeSM3VRzEx26m\nEFswB8QwZtulKTDPeplCFxiqFNrsTVaniVoorkrLKK7kqXAS4yeBciYPUMK7\nylU0X3XZ7RDmR2Q44coURUJM3dfHhft2h1qu6ci05XDPxms9b/Elg3RFpA9M\n46rXFnDLWzTSZToYuD8L+nFvAjMVWM7ejr1E88X2i8aNHwDo3ALkMOBXsOkT\nzsc89PXNFOqx4duwXrjm73xmCJEx7kUWguWOUynTMs9yj8GwKVTOupvqOZt0\nPTHSKPrAziLHv2l5y1dB4NQJPPS1A2rklYlOZm4RzUuMCKPcw2DSqwVs5Mz+\niC7gFLa6euxKzYw9o6eX7D87CxwLDCrjLd3pi7sf4Mv8ttBlAldeaB4V9A97\nsQz1SkzhXbUW4aQFQAMT7biB0hCSCDzpkLz2xQvhISTfI7nGIXCuWwz8pe5Q\nh3Aq9ImZPbpu+aAlDtGF/rZNIiSwI2w0dY2+DaSUnyWJrwyvSDFGwDKHBfyc\nC7Aq\r\n=myGD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHWLfpRky6xTCIOVyyxh8C7gGt1z+iSsZmCTA+5bAq9PAiEAzDt6TqCibS/TC+pjf1Ag3x9w8uzQLEUPHF6paY207T4="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.2_1564973247964_0.8401743318046484"},"_hasShrinkwrap":false},"5.0.0-beta.3":{"name":"next-offline","version":"5.0.0-beta.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","workbox-webpack-plugin":"5.0.0-alpha.2"},"readme":"ERROR: No README data found!","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.3","_nodeVersion":"8.16.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-+ZnFbGXQf7ld+rUrFuuqzfp5ChODgwPWvQ/Z3O5GL0bCrFpmybf6EIpO8Y9wlqm7DNy9vnlNe17KsFCvRy1bng==","shasum":"7dcf246870a21d7ed514c303e451ab74ca473833","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.3.tgz","fileCount":6,"unpackedSize":6882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdTxKoCRA9TVsSAnZWagAACXUQAKFtC/5x7kpqtGDm2Noh\n59iOJRnCupz3X1QHTVboRNsTTkGCdLA+B6q/WNJrmdTlBbVnNKdcu43R8kSM\nCHqmn60m4pdc1HJDxHGQgl1yFWY83f3hlQHXymSRjhIEY9N6gLV3hbhPs4FQ\n1fATZh1c9sVSOLiPvIeeN6/rbsDr7QhlYQqmS+tIkUNcLHhNb7UnUL04Lifd\nGcvDKuyjG0gxlOSbr57Z7zEjqY+y5/XaUXEnPO9003+/IM9r1h8z8zoWmfac\nJEBZQqXvvhBtcwKiuBhdEHW5xdA58Xe+9Eb/yLCYlKN2YyrrtKxuDGp4/t4q\nIqt7AumVzR/oIAUIya/OpzNQS/X4s22/YtTqMeh0H+8+FuTVIDjeDakBBXTv\nxarewXi+kotSCgqYpew6m+s99pvXsqdprlIPb5ZhT3WnqssIkkg8vUB86v2g\n8lalqMPXTZe5/d9JC1Ijz56OMUToIoEN/h1KrIhEoZEar9/4fyP7Nk2gzfFn\neM9C7qq536OyU+04ZG3w0NHd6B90hKRtA8uOpEpgZycYaZwcmuzJJkpevLXL\n2XgeEcQkIfmzh5GfdDqYqD6Mqsptdjh83PoK7UKJVkhqwTZPzCcTrzLcuMWc\n7SH2yNMnoPRKMQqR2vTocFO2HS0pgHc5YRWtjuT4A5ajTBUphFaWV2Ic8dR/\nxSff\r\n=ZE4Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALEcMh5/tICMCiiZdk4u1TGHmID2jfZCTJqqP7wmIsEAiBaLNgui5GRGILtse3v0iz5pBNFUVxkVfrOq1os5fZmUw=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.3_1565463207571_0.8114918524459924"},"_hasShrinkwrap":false},"4.0.4":{"name":"next-offline","version":"4.0.4","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.3.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"c52704932167e47f4db34023c79fa41260516359","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.4","_nodeVersion":"8.16.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-O90BpeTORXlzutdteuOzGktzvJPJclyGoSIfKIGt7nMcPTVZOIddFqiylie6uwVWe+Ljn0vEVHKFqz8INkcw3Q==","shasum":"d9c3e69fb239b7037baf5682783361b4c4526521","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.4.tgz","fileCount":10,"unpackedSize":24462,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdXYA/CRA9TVsSAnZWagAAAiAP/2R9tXwrHtwnYHhBAE3f\nGo/7dfseI45TjN3rlYnSoHKz3mD4hMkdS+XZF8icKq+mmlEqZBQKF+2jpohg\nFM+P0Pl2EXk9SGfjNoKE4bYhSMOPq091ZyL7NhAuSbuRt4scy5Vb/J+g4USV\nClYZ0omXDeowA0Y2++Vqbim7GwAhTadxeogijhPVtcBsm2Z9BYNgN3pM47Zz\np4fpuLt8ZnnyjxSPy/BQHFcoOh4z4bwkbHLFTBKOOL7rupOF7IDLl2o0OyMy\nwnwlAs+pvWWJzGYK6nF42vUd/y1lmMKnLEOLa5+R2vVRF9Q31HaD6qRJvyVT\nCxo8S3uUmAK49vb9ilHus7zwVgNlNPzJUcyQETWdRQ3lqA9HG/LiNI4X8Gqs\nGAmxwcCo04KlpciRA7BXJSXvXDVIdJAku9qr5x+w6zNY+8XDYc+2p4h1YPkS\nwLmgWQ4u67HJapaM7KL1NXQxOz/LnJNiwyOw4U2CC40OKTOIfc2wxEjcqWtg\nFLDrGT/GkU0Y2tttAmWLwJUxgMHUuG9NfNh/xKKseGxR+1ygk1qKqATHJE1Q\nYbTV6ch42acGUrNBQ6KDz367miVL1tMpW1J9JWUcSr79vBSVebpzmyC+4EcZ\nMpe4XpMTDvFvXJpPG/+iwB8fw7gkqf69h0PQXfFkTKhdKz3OmqOG6j0SggZt\nIaz3\r\n=io/w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBI9EDmLID0/oarDCIly9+zoxeZTSfn4gOAo5xFVtcUgIhAN1PfO4YFrxAMsomFFnel2eQdz9uxMaA/YzGaO7tx/lV"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.4_1566408766303_0.021346822694001233"},"_hasShrinkwrap":false},"4.0.5":{"name":"next-offline","version":"4.0.5","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.3.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"8992a9f42730baabc058a436fcd74e0e01a11242","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.5","_nodeVersion":"8.16.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-yoQx2PvtPICuz4NwSDrtNgfw9uSBbK0uh/MG+e59zFXDhA2n38M8+65My2WvXfR1JXQwSnrDlrIlWwc6x7kxsg==","shasum":"e77c7d38034bff969fa5ad3b5e1f18ce01d1ab7b","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.5.tgz","fileCount":10,"unpackedSize":24476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdXbIxCRA9TVsSAnZWagAAJTgP/1cJ2wngm0XX3X6gWyNe\niekZA440bs3IPFrU9ht3rV/J/LD/Vg7sg9KrnWx6TF4SlfnNszZCSl3ftlUn\nULXbsayG7439X0cnQjmTP/GacMRu1rgyUXOtp/BWEbmES+dUp1DCI0FwQBzU\nZfwBhbLFS7Pg1SWT/A2nloxnEkVAzqK7LsZiXYsCQmpTFEE1Z/mvZQD1r/6K\nSy4wFlwAWd4e83GSFlTrDQYoTZ1x3MTB1/87wW0WG220gTpY7rUEAPV8kCc4\neXnytS6eHArXPuEVWrN2gjJQpF3hWgB1Smvio9rmP2wPFe396ADDbfjUsQap\nSIE/Ku36TCgWwpnx997g2O/s9xexzZNfMxmxS1v9w0i6To3Fhr6ZeE6nT6Fl\n92+/h1t3XvCiv05uylmDbX47AKD/jwrBx8Z824zAVHXcZ1Nw1i1UVtB0Au1E\ntJ2uR86gUlUNmcTs5rq4zni7uaEh8z2jPjbPTICVZQo6mch/cUeQFSRAkiMc\ncRmxUOiAJRmr7xIsORlBJrNCgXvUBbixmWZNs+EfBbKtkkuB6s1Mldz/kQrg\nux3f33rAnl4k4KpaTVOhYZIFMSMt/3OA8tbd0NiFJptCz7zeToctqfPTt7GC\nlGhqJACJg/3RFcsNKXjyeDBoFIwbhmCyTqxMbg9TPZ6qhUMla55BzTMTpyRI\nvFHn\r\n=nObe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHcCxdwzvf3vc5ke647IBHBHo3mMtsyq8Xbi/Eq1YUyAIgSJdnFj/wl7rVNxdPYqgxeGm6OVCeGifoQz9NQGlM7HY="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.5_1566421552993_0.9210901243673661"},"_hasShrinkwrap":false},"5.0.0-beta.4":{"name":"next-offline","version":"5.0.0-beta.4","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","workbox-webpack-plugin":"^5.0.0-beta.0"},"readme":"ERROR: No README data found!","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.4","_nodeVersion":"8.16.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-opsYMHQVCX1MkG//G8XnKzoH3IBimjzFAfLhN+Lko5joT/+ILugIcq3zC93jCgnuq8f2YWUZ4PtuomJkrw0VyQ==","shasum":"159d97109de672a0d4553caf8ea00b145846b230","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.4.tgz","fileCount":6,"unpackedSize":6882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdXzajCRA9TVsSAnZWagAAmKkP/1aMAu9YChjBuz5Wv3HW\ngM2FAM0cFOzc+BlB/T0xcI+L5n/EqjgJrtakEpkxcAnf0rGvDsNtAd22z0J6\nu4SHutc3R3FjVWNrUsV23uKaxTT66WabeM3W6rB2u9ubH0UqIx5LE2GCCfXO\nRgQBqxDoxfuZtMD9XYKuW/vm3z6D9OKcEOLcXah8BrHohhpB0ENRsOn3zGkf\n4VY1CtvOIQ+3j87eLXftTBEsotDfVJZljcn45s/F1J4g5bbMBZO2zR/YnRhn\nXnX+p/QgnYYGIRXqIhqVXbWRmq9w2CVs7x/CgKvz5B+aMIOm7e1shYFSbj6M\nLbE4yLqpiIrDKr5QF+cjLkpg+VT/LjboDlIUA2W9+AJPAkK3oraZtx9Ibu9+\nz74WZoDEi63uMJPq3kizbIfn0MnL40E3wECP5Cwdfy5tlqVy5vdX38Bkxodo\n67/0Uy5uHkoLdJkqNQSWhkW92ZKa/o+uyitbdjTtnjP8tzwjeRFagp8fLylX\n0NsYFKhyZe7/Q61Tdax/cnoSFp7V8fwuE9L+B2nUkogasO45gayw7rNQtVb9\nNnoK8kPrSzkYcu1lLsYuNr1PtOe0/G4CV9VxlI7BxiVYimffMHpPKSEWvpnC\nYouT27/RpM/wgCNuMALlX+XvOAAwFFqUdpuefFpBu5ZaSjRNA1re6kxT9Ac2\nQPYn\r\n=nm0x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUSDY/5phLzVgeBT/ApcngKzmxL8xHu7KdcrJ8pR35egIgC8fkwacMs/kouBAzEtJ9z0AnYbuZiA1Q7KIVW0wEmW0="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.4_1566520994928_0.60903013671712"},"_hasShrinkwrap":false},"5.0.0-beta.5":{"name":"next-offline","version":"5.0.0-beta.5","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","workbox-webpack-plugin":"^4.3.1"},"gitHead":"69d0c008ac4f6785d0907ea58b4189d8c390506b","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.5","_nodeVersion":"8.16.0","_npmVersion":"lerna/3.16.4/node@v8.16.0+x64 (darwin)","dist":{"integrity":"sha512-6E5UGUWmAsQ9pN7MmVaBnFt1ZOKYOJYg9B3rLlXcy8Q+jz57DJwPNnPL6nWtBh1b6L5uiLDLFwrwJrBF9mDLfg==","shasum":"09aebd99e915d0db3ef1c1e8a126b74c6fb80b90","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.5.tgz","fileCount":6,"unpackedSize":6932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlhNMCRA9TVsSAnZWagAAYiIP/0IuKfgprP7T+dIqXyiB\nZjYp0j58OIDYeUR4TGneCrTOWD/TNLLwrNBo6z1RxdbXOY0JHe9jNQNKnXd6\nQCPXY1W3yHuVKGSjYXww2dG+dp+e3Q5s36OU2/+E6knR6xH+nMWin5bFdKtc\n72VJMEMLhPtSZ4N+qliEHhUEZtHhoqPo9ot8wmIfrcxjMQ/EtV8vgifEB43n\n9x+32xLVhoZIjV6v6oXURXm0Uq8fxzfWKNVUjtCuSB6n54cpmc2KYyIzx7yW\nF5EoJbUfOQelzX1Dse4es8JX8rX87WNOs+Lg6OxpUVIq7zmOSG6EoQz472SU\nu2rjf/8SpJWs5PzRL8JhLB+HY6K4aJV9CbLD9ix8fjofpBqO5lx/FVd/wYvX\nFqYCtcGVb0pjS+YSVznpWMOIureXR8zPC+VBZpPKeixtEPeJYxNtyHh/cfbN\nIdfCaKoBsPg2uI5cqOs8XoFGPY2tkzd1gW5B3HySt0ZoqEJZcV3fCNZ7BAyq\nnXm+buTdF7eDPMRK/q23ILnAryhY+gGVmv+uYtic7cgeSLVqFDyBkY1rakiL\n6B9vETy460gW1Rqf2Synq5zEvTkqYg/9DJNxiHNAx8GnKN0oAhVoPYtnU/da\nmwti7xz0Kykc8ESGl83RIj1b57Yscd4IRriQw6mzk6p3udcr/WneCkzjLdyi\n//g0\r\n=RJMQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFqHLkIQiZg/2P2RB9ukKSzdAGRqWKcuG8jEbAGrwNGEAiEA1ccQl4rkyMBFzDyOQvjzUMKUi9nIq4JmgVYav1lUCAA="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.5_1570116427397_0.6947906518495925"},"_hasShrinkwrap":false},"4.0.6":{"name":"next-offline","version":"4.0.6","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"scripts":{"test":"cd tests && yarn test"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"contributors":[{"name":"Joao Vieira","email":"joaoguerravieira@gmail.com"}],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0"},"dependencies":{"clean-webpack-plugin":"^0.1.19","copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","glob":"~7.1.3","webpack":"^4.19.1","workbox-webpack-plugin":"^4.3.1"},"devDependencies":{"husky":"^0.14.3","prettier":"^1.14.3","pretty-quick":"^1.7.0"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"8992a9f42730baabc058a436fcd74e0e01a11242","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@4.0.6","_nodeVersion":"8.16.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-uLU1g2DrAdIilTUUznBlrymDaQA4WFfZA3lDmTDZ6hUIai1X/JlghiMmuBEwPuuJEdZHv1ExBpyucoUSNpXjlg==","shasum":"c2c5f1a08518b83cd60cafb9485752955ebefc00","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-4.0.6.tgz","fileCount":10,"unpackedSize":24476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlhO+CRA9TVsSAnZWagAAfGcP/ie24/jZ9APV5A68UWuk\nFkSZKYdBL1Zd9PD0dQfyXl1tYSkZl7Oj0Ms4gfN4EtfoXLANyM6BkieSJiYS\nqgEMqFjd0jvWOvNIXWqEurt5e7/ituz2foS7lP3PHOa1wZPcUaTmJE4cSAsP\nrb3oB9F5GhoZ03a0OiqnTLZYJNLujxIkJE86dSY4HpSK6pFGDcMbhFeZp4qJ\nkZnvStfO4CnyuAgI+wT6YmIHBq4d1CA7rV0Kw0divwxyXI3mo/r7w9jX5h9N\n0CCzE7XQ6zs/g6JE4t/D9urww3dqeRnllil93ZWnbYtCEoj7/MAtudjqInoi\nx7A2qlp6dQD6U7EVAcQhwE4r3XM5/yTHdldVQJz/HuRHbGQuq6sF0ONI3fSL\nS4O1pdM1UAtqndaWIKiOJhl+wOXJf9oC0M2bsll8otjqEr3A/lIyzheNlgZ8\nWD8H6yFJmQNqwGmK0GmVHB8H9zN6iAUBH8etz18/p6vBPJzU+0hw5f940MAc\nqF6OTUhWk0XXea7hm3Kn+KFAk0IgssFOyoniTbRI7Vb2XtqW9p+TcXt4dL1V\n0LI6XtawExW86buu22YZxkFaVdwaxlyuNLg6S5oIbhlABd4UbmTBMZ/xIush\ngtW08rU3prC0mDrPoi1fkRU+ychP15BLO96tjM5DqBwRgml2vnJaklabE3PT\nKjJQ\r\n=JyWX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDl0Nosc5Mzqlt4yQ3Dq83ksLhT//w+leVIh7y9wxQk4AiBqOlGznV3sC0youFe5mAkFRSUaxU/uQG8L+YYTkaUvog=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_4.0.6_1570116541234_0.4491038041493012"},"_hasShrinkwrap":false},"5.0.0-6.0":{"name":"next-offline","version":"5.0.0-6.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","workbox-webpack-plugin":"^4.3.1"},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 5.0](#next-offline-50)\n- [Contrbuting](#contributing)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/packages/now2-example). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/packages/now2-example/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## Contributing\n`next-offline` is a [lerna monorepo](https://lerna.js.org/)  which uses yarn workspaces. After cloning the repo, run the following\n\n```sh\n$ yarn bootstrap\n```\n\nThis will ensure your development version of next-offline is symlinked in the examples & tests which should allow you to quickly make changes!\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-6.0","_nodeVersion":"8.16.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-sRvLWiK/0ii4pyWcCFhNWfcuCs/u2cSSWvrFWlH5xSaIiYqjpJqT46NWbFxJMgQ+GZF6S27BpszaG8Pg829BeQ==","shasum":"e061f949e30230de9a9212025ceeac3765463968","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-6.0.tgz","fileCount":7,"unpackedSize":20123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlhSpCRA9TVsSAnZWagAABCsP/3NtAJG3RNrrjY3CphIK\nHou5tLXo/NpAY6uq5dt5TOS4Uc+79Oj3e4B/7LcV047/hqqqUnzA39q5Y++s\nSuH/JXes2/s8WMhFVocCyGKhRggbzfjFnhP/qlJBoOcQHOIYqaHmsddFGKTO\nOTuH6QoBkOr0CW3At3tVuT+Zbh2EO3voJtXakNn8ihZNw2nnQm1aSVpnwLcy\nfdZg9b7lftSKGKpiNR6sCU+l/G5Q4CZ4HQ6Mo2UY3N9FP0w8ctfHKba5KaYK\nTwD4ojTDBLN/m1D9q2WHLh03lc1GuWCdfefvwaHStgXBoTfOh85OE5cmceje\nQ0pYUy1M/BAC8fqtO2Um2yfoV6GsocIkJlCTc5HMLNeilGS4+NU830ZwrAor\nqVMRO9x5Bo4rnRtL/gOmdOpYvwLHLSGt6lDGce61O6ccHb40N+NFON62FFbh\ngw7FqPAGk3aa05822OEU7qhdWF/8k2A9pl16yRsFq0CBgfcRwyClQ73U62lW\n9wolyvOwoIDmrZv3gOCdD5RSymKdOXgOy1K40I02baEc0YM4aEfcKpZ/2GxB\nW0YX9sp1WfV1LFJtiYgY0mcMSClcikWznC/mhhOL/wK4T5Ef0MS78LPIq9NN\nteABVw9HgKWWmS1r7YNFW1UUnfduWiqAyBVmpYkAk8KNabLXPpCYlBYHTrML\n39tW\r\n=p0M3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9evU0tqWisxNL0Dq19466dhD8HxvG8GXleCah0iC2fQIhAN4738ajrfKKTkW9Vjj9EfEumzF/9cqbXWvq4o0GsXsG"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-6.0_1570116776754_0.7340273625357547"},"_hasShrinkwrap":false},"5.0.0-beta.6":{"name":"next-offline","version":"5.0.0-beta.6","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","workbox-webpack-plugin":"^4.3.1"},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 5.0](#next-offline-50)\n- [Contrbuting](#contributing)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/packages/now2-example). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/packages/now2-example/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## Contributing\n`next-offline` is a [lerna monorepo](https://lerna.js.org/)  which uses yarn workspaces. After cloning the repo, run the following\n\n```sh\n$ yarn bootstrap\n```\n\nThis will ensure your development version of next-offline is symlinked in the examples & tests which should allow you to quickly make changes!\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.6","_nodeVersion":"8.16.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-hltfKsCAFhtGnEpzTSNe71Yon+QGNeuW7R6hTlr26RmxWu1V5reMUIaObO1dskWl1zmWXGxoEmoe6IS/nHRvRg==","shasum":"f35347032c291a2e5d7ba3ed0869f8b4c8ac9a31","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.6.tgz","fileCount":7,"unpackedSize":20126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlhT5CRA9TVsSAnZWagAAif8P/1LOUiiFkFX6Fis+m4NE\naOBHb28HYAl6nCD/SXsKeYIxrY6LrMSNZRzuBEeqV0Sux6HBkZZJprHbEWYa\nQ7eURFJyV901dLHLL3WXf9GV8QGMzD6+y9NFc/YGqNKh6a+JGwJfxQ1br/N1\nwIUEADzR9gTRm+fkiqzOfoQ7RqiyP8PVnY/mOuW4fVSR0pPn+VQ097WHzUw2\nCSZOcrWzshB3x6d7w1vvYVAwvY18LFYG80Rb82d6PLpcHKm8ROkj8HuyadbB\ng0WQfSSJXNAgBOl/aWN5o9IcvX7MKAHhDGVvVOtxCN4cllqEBYvONA9SIusn\nmfATn/utfnVpzFmW7fPxrkQieEOgt4houx34+/P09hUVKPVe2pGiBV8twPST\nI2K3aNZVoh+k/U95cqFOAzYOMSZuro//mdb8F6HkRW4oyVMzYjRNRZM2fksf\nH0bnjF8VJAi9ZOqXMjN37+00q31tYpEdu5y3xkNmeEW5ufnDiMETc11/jKJD\ni8TTLtxA0qEn32usbI1Y+kZfIfqZ0nTunFE6xpYj4mQsMVAoExGJE39417w+\nnhwixB+D4coexjnpWTKkXZbyfUbfbyxj6SlYYMCGdw4+QB9Q0IKAj8vFmMjW\nZQPMxqqHqScG9zGM5qjxCDRV8CcCIVrOvhQm7u5cC8MiEJU91z2fNM1VQdtG\nkovb\r\n=DaeX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDfxPZmDmh+ZBL3l673Uo7pfz++kAh94QrvORks8/qekAiBn57PPNcNv+HRMnIXMny5nmFbaWhDQ0njrXyta/JU2iA=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.6_1570116856913_0.954559186453279"},"_hasShrinkwrap":false},"5.0.0-beta.7":{"name":"next-offline","version":"5.0.0-beta.7","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","workbox-webpack-plugin":"^5.0.0-beta.1"},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 5.0](#next-offline-50)\n- [Contrbuting](#contributing)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/packages/now2-example). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/packages/now2-example/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## Contributing\n`next-offline` is a [lerna monorepo](https://lerna.js.org/)  which uses yarn workspaces. After cloning the repo, run the following\n\n```sh\n$ yarn bootstrap\n```\n\nThis will ensure your development version of next-offline is symlinked in the examples & tests which should allow you to quickly make changes!\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.7","_nodeVersion":"8.16.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-pLDqo9DL5ahHj/aqIVJ9RXJuKN7yGWAjIYGop8M3LE+LYHglgfyx64v87Defnfax/YKPH8xerHIi4wPmYtFuew==","shasum":"10c77cb446a80e13612c04ce4af6307770138995","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.7.tgz","fileCount":7,"unpackedSize":20133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlnCnCRA9TVsSAnZWagAAa0kP/j5v+x9EHLXDwtTFqaYJ\nWUIMtQYljFbbRgjjh9RHJjL6VEUqaHAXQfW6T2tUvcC+HAUtf7yY2T6tc11a\n6D0del/8WDxD+DbOPI9VOuPbQdPEz+Ku6S2Qezz+Sfsa7BaU+9Hvk0Y6xmq2\n79RLSTGlKtjlPLHykibqtec/GPiFSv3iQ/1WDitae0kHm4yGh9Fu2shEVBox\nCnc43eomlUn0S1tBwkefpwWviAmZWjbnxWS/ADmde6wKIhCn3OfIcWVlgxOy\nRpXmNxximEp+m6znPBuTX4qmlk3eZIC4yeO8W6CVb4EhchlWrsKK5PArwaQg\nGO8OcQVMIMupe7XgnONgO+1UuDDK+vJEgbkCT+sgCeQS3OelZ9/ZZr1V9LbX\nrxwo2juqzqhA6+S1wdVD4eNfbjcM7aIECaMmXQ9qUYJx9Ec0izBvL413xigP\nWwnYigZYvDURWEoPXcx9cayH3Tz8bM8buxZwAUQ2wQTdUgqi8uwgz8gL0zfK\nEYsVsDELujXQTtRw2ibUpBlLx4ENDdcolQpxIip+NBr85ISVSk+wvCCmZTDQ\n+L2/tY2aYryxrOxA5vhGfujxm10f5BMkjaxcixGZs7TyActu5NFr1F1zZNHC\n9uf8QGzrhdz/DhcD47pgcTaEhVR0nnTMUC/j0Ym4rjUwxHoYpneCt8vWNxNz\njC31\r\n=0T0T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ/A6ym2r4heGgCKy3PWdENLnTCR2uahOr8LBCjGC0EwIhALKij3RP0OQGt+p6VcoHU8vxZinqGYcIrexUXRlRDr9s"}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.7_1570140326556_0.2875294736097431"},"_hasShrinkwrap":false},"5.0.0-beta.8":{"name":"next-offline","version":"5.0.0-beta.8","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~4.5.2","fs-extra":"~7.0.0","workbox-webpack-plugin":"^5.0.0-rc.0"},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 5.0](#next-offline-50)\n- [Contrbuting](#contributing)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/packages/now2-example). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/packages/now2-example/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## Contributing\n`next-offline` is a [lerna monorepo](https://lerna.js.org/)  which uses yarn workspaces. After cloning the repo, run the following\n\n```sh\n$ yarn bootstrap\n```\n\nThis will ensure your development version of next-offline is symlinked in the examples & tests which should allow you to quickly make changes!\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.8","_nodeVersion":"8.16.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-DP/mtnjdPqh60egF/L7dDTSxX/OSXNoMMJuhEqsCaoAWaXCBwOEqEM0sgcy7HscQohHRGBJXIz4wmE9o5qamJA==","shasum":"ce5f18cfd011fde99cef25c5b366bccc55b6eb2e","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.8.tgz","fileCount":7,"unpackedSize":20131,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdscO7CRA9TVsSAnZWagAAqVUQAJOuUSlHJAUzjUbAGEm1\noFbnoxf5B3p5vEKvBrfw4aDdmfnurmNgW56xKvVFlyopvimtvbwSJwjwGezP\n9IyEYrqirntbzn7Mb7i2lR2K7vQCfoQc2mBmqNewTzJRjLkVCsqgZfhVuJ4+\nrWYyJm7izYl936R7elFy6va9hfMboEaRi/XfzedArImX48aXuMJ7p9f0xnv8\nqjZ5UMijhP3/0lNgyOXqjkoSz80y5SP9wpYv10/JT+MgYTi+SRQccVNyoZBr\nm5vlLjuoCHLri8M6J1NMUmlUwWPVU6V/DXG5gbvAVNUHvR+ikeZbrFsBbRFT\nnYrU9Ef6bY4/OjttRM5L/RGHpBXUNf5hMsJdulcvSPOqSNQfiKB95NNIi+4b\n8EUmf/TvM2s9jR4UfXw3+VbyA8NeCcJ0koYkm9xivODnJ/w80XtuzbG79Pkd\n1oa7K8R6uGYI75YF6SzQ5gVLHXXkRhYmqgLe7r5nsifFogJNrTf3N1USyBph\n/PjW7Luyp4sha9k27AI4SdexvMgsDzREEaQnMlBOmpBaFY8lzpHOSvDly7VB\nWz56ax4xJFkCpVhhpATAjOSBG597nWlCC4yB663bd4XtlmKRoCORIFdMnhi2\nHpskoc3AhPoA9u1g7jzQqs4SL9w0vqD5QL6HLzzLTKRF2LvAkrj58n7Gc5Rg\nHmZa\r\n=mW2C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzY+ZZq65yn09Ewo9+HcLWHnTa957Q+ePZEq97k4nohwIgd9bju+d7wYxTQ+IlPFbLkHZ4ylWhqCvWt5qtDkvR8Lw="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.8_1571931067006_0.08594686650168515"},"_hasShrinkwrap":false},"5.0.0-beta.9":{"name":"next-offline","version":"5.0.0-beta.9","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~5.0.5","fs-extra":"~8.1.0","workbox-webpack-plugin":"^5.0.0-rc.0"},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 5.0](#next-offline-50)\n- [Contrbuting](#contributing)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/packages/now2-example). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/packages/now2-example/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## Contributing\n`next-offline` is a [lerna monorepo](https://lerna.js.org/)  which uses yarn workspaces. After cloning the repo, run the following\n\n```sh\n$ yarn bootstrap\n```\n\nThis will ensure your development version of next-offline is symlinked in the examples & tests which should allow you to quickly make changes!\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.9","_nodeVersion":"8.16.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-NVfuUFFIpXtLe5y9uBhiDdJXcqbBPBCtfNl7fn3oT8ZISm7Z/S5aeZL4ThNbrvvC0X72Zx22f9v0vEa3PpBLrQ==","shasum":"6a9ff1a8402e29c0814cc9056e8ed3e5ed1255c4","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.9.tgz","fileCount":7,"unpackedSize":20055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0dFJCRA9TVsSAnZWagAA2yoP/0rDDhUFZuBLmdhg9eiw\nBm4flDVaxnHed7/Qs3pINj1mQjhKRT7OE3RBhxYs4ljHTQUdZ9AnLMEV2+YA\n0exhdxWny9Enk+lNG2NcmlAiFGIYyCV+azDFp/HmAMVAegTLXBCbBAegJnaL\nmcMsnZdGNQY1LBjY/DkOsQ/duRXXV0aalTNDSGQqwuRKU/pdKo9ElzcmJ1HH\n7f2JNxAWqEIPU9KLIEBNFs36+6IcQE9st/Og04I49qQzSrJaRu6qBcr2/iX+\nYdhSdRmjGFmHKR+QB/X1GUfqV23jyhIiJUVSbJDVeLDLwvcCmEprvtEZwYNZ\nbB4k77H4UHwfC8FyCCa7ozbVVi/eSshNgPtKTWmwSGX+jqP0BBcvgXFkWYHI\nwjBTZxlo03wS8GGYzaXNd40YF2MP0YJTLDkVOamBhFrz2VZN1iQ1tAGdiCM0\nGIXwXLHoKpr01W9dExlspRAOmnPNXbapcCoKDE1C0xV5LVVhG+gxrkwoK573\no0Kwujzl5w4F2zbTyNFtFSDJQpdXROAUt7NULpFsxno014QUzyogarwbjbQL\naVXluzM7OCPDZtkU/6f8ElweFRbRrUPjjBrmpZ8aWHRw8wMlgfkpqcKZIduY\n8RaNuxQ/XdBKCz7PZdJ06om6z8twX/08Wwql5oB+39n9LWJeF7GAa9K0ym7a\nFuzU\r\n=rmmz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGHNmpAHnRPu4ctWTIArprD1NuwmEkCdkDQoLJz3ZUkuAiAmh1t3oPDsVkZFOomAd3juLwVq3XpHMj45184ZJsFPbg=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.9_1574031689440_0.37924703479821154"},"_hasShrinkwrap":false},"5.0.0-beta.10":{"name":"next-offline","version":"5.0.0-beta.10","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~5.0.5","fs-extra":"~8.1.0","workbox-webpack-plugin":"^5.0.0-rc.0"},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 5.0](#next-offline-50)\n- [Contrbuting](#contributing)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/packages/now2-example). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/packages/now2-example/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## Contributing\n`next-offline` is a [lerna monorepo](https://lerna.js.org/)  which uses yarn workspaces. After cloning the repo, run the following\n\n```sh\n$ yarn bootstrap\n```\n\nThis will ensure your development version of next-offline is symlinked in the examples & tests which should allow you to quickly make changes!\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.10","_nodeVersion":"8.16.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-aen0charVWQ40o4B5RaY4bx8ef4duFveVfTRpzh82Pj+kCN1ko22/18Mj93frcRDimJ/YRbI/WnPWvPFGlos5g==","shasum":"9dc6bebdcc63345648f24c40d4b124fbb6d809a3","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.10.tgz","fileCount":7,"unpackedSize":20056,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0ddKCRA9TVsSAnZWagAA/34QAJ+NYnicp5cpWcUZUGIX\nOPLRyPgz48l0/bi91ndHsrffp9DJg8LB/SlWQoJL5Gem2cCEIyWx108nfSjn\namDtH5ItYhJF9DjcEt6UIW5uB4AMOV+LuAHWnLMIUL2DPDh2Wko3OE4Foiow\nveArxAHOeQkJZq/psuWuG9g4hlLMStT282Zx5cLHWHAg3Ccq1UOXeNwYp0cM\nu3Zj0TRjZTCAVeRc3DzoQVrinOx7hzhAcDdftoItr3jvKCj8Gkf8Xm3rwqol\nr/rLP3spj/Dhk1ycKXWUMq3GPfW5/WSc3V27HaZOWR3HSMOr/ER8nE0NSeHZ\nEojC3uw4mRaapvbLiMz7VG3IW+Wa8ytiheq4eLiyDWyqut+gobjs7uhTT5f7\nu0wzUHXsxWDJjZ4GK+jBzSAfwN6wES32x/U56Ovklgf+d1BNUKW37h6gYZ5g\nJsjHuh6MakLGCXQ8fetf8SQPxwjvWTJwt8YLCymeoqMNy5ub7HQcKOQxFsJP\nyY+bh9B60qScZkLs058kWmvWQaL33CmFipeZEj0l2ZyI+NGZHeDyF1pOs9se\nCObGFZaFy4mF45rZLKOYQ/WhmhfAatsd4GY1m8tmadDWUQ0SCgtZeepfXgBS\n8Vq7uzH7PHgMordeZFod/NXjrdCEqeRQNTUHSiqExzZQp5nIY0j9I8ysGhWW\njGOK\r\n=c/1s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAGdB9ArVCvgNyF+IMHLwD1DSH5d6PLmQiG+F8rau5OaAiEAjROpvOS/TqGQKmxxC+AEbZs8ZQZQNA+i1FwcNCPEBGI="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.10_1574033226258_0.3944132264645006"},"_hasShrinkwrap":false},"5.0.0-beta.11":{"name":"next-offline","version":"5.0.0-beta.11","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~5.0.5","fs-extra":"~8.1.0","workbox-webpack-plugin":"5.0.0-rc.1"},"readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 5.0](#next-offline-50)\n- [Contrbuting](#contributing)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/packages/now2-example). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/packages/now2-example/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## Contributing\n`next-offline` is a [lerna monorepo](https://lerna.js.org/)  which uses yarn workspaces. After cloning the repo, run the following\n\n```sh\n$ yarn bootstrap\n```\n\nThis will ensure your development version of next-offline is symlinked in the examples & tests which should allow you to quickly make changes!\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0-beta.11","_nodeVersion":"10.17.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-01d7hgtKKHrKjeiY4+Hhtsb8bwgQMwLuSpsUuLg5HwdU8QhuofI2W2Bk6VSDtbntcMoCmt5qQZX0UdS7bdi2gQ==","shasum":"bbcacf7b2b3233f71150c0f38cccd38c170987d2","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0-beta.11.tgz","fileCount":7,"unpackedSize":20055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5pmUCRA9TVsSAnZWagAA+UgQAKB7x/0WTLbn54ZAZLsM\njou4brcvwUO2vCDOLIw2A3zKBhNrDVVhzBRUX7GbPq976VS880smjznwtH4G\narCCYxZzXCn6T8Iz7mvrehY8wW0d+0CTZsN/6pOG+J6uZqu6clbWGK4gejYm\nZezgb9oTSTjuf/N8n4ehWVLUD2FCb1P9oK30FULUOeJGHVdG08f3tYK+knMV\nReKIVyQu2ibl1ev+lOzqwignM3imgUJO82mqPLVJ9N2RhlRjTwBbEJj8bO44\nm3TEV93/aZphL1g8TWMuQDTV53xibscecISEEdpqY6G0yXjoCv/SsvXyuDQx\nabH8JEfYK+olvFqzUJr72sJr7nQeZjJYcJ2LMriUha2RNoh9MqsbOQlIdCCT\nNJL/W4uGWbB8HINhFSpi5m6aDlvQn6072Y+jZCjqQGJblAZltZWlcx3ssudh\nc349yLirZiMC9JKqSzxHfvtl/I1dx1xAGNgAxb/+HhWhRvc2IcQyvQMpHJnE\nDKp4KghLyVesxBTtlXFZ+wGrY312A87n+1Rzggx1y4/m2f8dWcjwAj6uiVGV\nTCYeF093wt+hbXQQd1aLULFJog/beelr85OJ+be4O9j0ZRBmR7ZNYwj+eaS+\nY8jyiPUlMeMApjxYv0eJRuhC+tUVy3IwoIgfhx0EvNbxIMjEF8A3c/l4a6HD\nF35j\r\n=jirG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDLx8tX6+X6XCd9P4P4g8a9wX11eFM1xyGmN2rldlg17AiAI0mshaFFat0xlgYSydVcrvsK6O5RvQSNE/e5qUMBGbQ=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0-beta.11_1575393683600_0.11932968749456263"},"_hasShrinkwrap":false},"5.0.0":{"name":"next-offline","version":"5.0.0","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~5.0.5","fs-extra":"~8.1.0","workbox-webpack-plugin":"^5.0.0"},"description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.0","_nodeVersion":"8.17.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-u3w+OCtWX0B1gES8L+mWhf1aPk3t81eGqaeukswnzLgdCVjSrbrMB3YcdoWMf80Vf5k6IcgGNVU2sGZVdqjnUQ==","shasum":"bd47a795965aceace38cdb60709c8ef980c49559","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.0.tgz","fileCount":7,"unpackedSize":20043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMwpoCRA9TVsSAnZWagAA9aMP/1DPtNn2rbW1WXfrOPDX\nJdcrrPEtwaTO3NateMswTJX1rJ7Paw118LhXQrpH7DiasiiR0ZI4xkrVOFE7\ncbomxR70C8+EVeRPMRYk5xMEiji/fRhVbzd70ej1HMOABVphn1vyKlddQWdl\nHi5yMsiZ9R0h1j++3A22Km9C1pSG68d7an66mD7uHvRw25dYjlincs0wQ6C3\nXZZrdqMzCLoTz0QCib57SlY/Lx52sIRoaIiYQjp+bFygdOb3m7pkf95Zs0lo\nwowiYDLLubGAsrtT0HqAHsYv0+YigoStAB1jsYSxhv2c5MbrKtAFMONpc2nJ\ngK+dJI74lOPe7NYPsfaBLRtTpHc7vmrePmJ1JA1l+gx6eD5Fkp3p4Be+Ngex\nUg+SVJzN5Xeurs0rjJXGAGGu8e/t536m8ppM2bBGsOwXP5kABuUZL0kya+VP\nDI6erSB1ZbsZ2NbGDNf2+pZOgQZHN4fJvk5dFGGOqs/s/bnCcnFxV5AJsxZx\nHIEe4S7wnrEL5JMY21Or9HVLKy6CWkYWiQmj3G946v+D1EyVjQlR4KN7KWnQ\nYbGwCejrOyH5FcWIFx5GSWxhGGey+OKpOoqrggDNFkTHwH9giV3hOT8hrUz8\nfpmocU7IzOzoRAa7Im3feVrW/WQfzvYcOQa5siVCwWUKFTlbqTRUBN3DoR25\nNI1S\r\n=anbQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHhj6XR+mDPki1vGejOhduwg23w24NXhoFsnF0YcaMfzAiEApQL4V6P5Ag73vc3w/RHzL4RhuNrgobLeVap5FSEMTMU="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.0_1580403303851_0.29563196792855706"},"_hasShrinkwrap":false},"5.0.1":{"name":"next-offline","version":"5.0.1","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~5.0.5","fs-extra":"~8.1.0","workbox-webpack-plugin":"^5.0.0"},"description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.1","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-zDQ5Acg4mYUXgvXQSbFuripas802R0al/hl0T6W492ZMpnJT8XIGikodjrQafdldZRObcwXt26u1hmtVDVsVZA==","shasum":"3c95bf0ce19c5d39ab6a5533cb756b4362cf4072","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.1.tgz","fileCount":7,"unpackedSize":20053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJem2pyCRA9TVsSAnZWagAAQswP/RW7AE4u1aO9ri546bLv\nRxdeQ2UlBYlTCmLQIgy5oxhzATd9JYpgs9QSf417WmWARdpNa8znWPLEccx2\n7xiqLA64QaX1HN7w1+xDxq0+ktaCifGWh1gFmQXBAUHw65JFYOJ/Mulxxo5S\nTUuOH8r+iGH0+cogG21DpNJD9bvgb1I+IdNHndc9rToKYQAT7K4uNp4WqLEl\nvrAucUiiWL4LQA0FEes03PacTmAWaDO7ygv5o1QB8/yEF1Ice8UXqYgmWSjc\naf9oipBvB10atqFfVdlyJBQQyz/H7sp3NEg4F6M3hjEj8QSs5ZBrNUdmoVGt\nkFLOnL75845Q1aY8PVzc8hL20qJoXWpaEvR4u2RGPm5H3CJnXf1tY7EHfx9G\nEB3EN0V6iRDZFYh+rShAZovOaW4Xg9kbhroEnWKxK4tsR8l0iQw/lW5h0vCl\nmpJVdX7YABzSEtgOPUUsOHeW5TRV/RqxaJaBdFds4KMiMmyQhlURgfM6ZB4c\nNCPwhfrCEe2W6INIrNJvGzqts6uuWyYnyvz2uP+vEPFO5eQrjZTYHMEB/lM+\nvMj9OYqT9qAD5GxQKKOQgTdZ3omUqHSljzHPROk18twDqDFvI35pvV4F6/KE\niqsJdSiKEl1d/H9DvtsRUTAhkQTtI0C3VIHxhNin14KcBzO4nxQyzU4x9Jsu\nXR6N\r\n=gV5Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEKlNj5BhE2ntEWExLSyOdMkOdNl/YHa5Bi3022q/kNfAiBVz/kgnZtPvkGCS0R1NDn0fKxFiXXOzwWF1uHXF142RQ=="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.1_1587243633314_0.9348880521782639"},"_hasShrinkwrap":false},"5.0.2":{"name":"next-offline","version":"5.0.2","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~5.0.5","fs-extra":"~8.1.0","workbox-webpack-plugin":"^5.0.0"},"description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.2","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8L2kMhKLSGLfB1k7NgZrAkCDOhFU1z+emT1p9QJb3kkHi+kHI376y+veqe6HwECutNP1b/LFErxDwlBqRSSIEA==","shasum":"54078e2626bcd4efeb674f5ac4d0b318e4d51b80","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.2.tgz","fileCount":7,"unpackedSize":20071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqROpCRA9TVsSAnZWagAAG40QAI66GYeq7JmEmD5pRG4O\nJGwr3T3jc88pO5nS8uJZyPgeXKOIzb+3zyEUKJDNTI6+D5dEog5WZWWIB/3N\nYT7Dw3D4Y+YJU/AYWpf1AHteU3NEF57ziyKPBPjHengIlGw2d9I7XqkoLk+i\nJ/OMXtJMeK3mBV0HKOHpp8/xCMclcOvFmWefmBYW2+bX8ea+1i8p5U/CWpah\nUcq2+OJvQx0PV4n3eRfGJVFahMRNeoARV0H/ed8j9rHYC1ZqeIjc4b47ldUq\ndR0rXqdztNIHtXMzfN8PrIcErVmNajADQgkFvjv3QOWZ8gYc9WgL3R2JkLQS\naUmNKBpauy6EWx5z5NSC2mlCcfD90XhuDiX4hVAHg2aOibMJ3wGq/LXb8acf\nVpfKl1h+XRDk2zGGF27Zjdusf5SiUWT6uj0n/BOV3rMxGIkZJ1Re0H6quXrv\nc9r/oQvGOwYSvZntk0UYZQoN8m5Gq6Monza44S9GXmMtEk3E/eTCG/a8affg\n9FVHLQS7atx8wU/KQrdK/V2geJ4VktEKZjh90jZCLcMbC7TEslVyQmf0EFZL\nQhSom/jKLFxovUhWPQS2H6DPsTfTdC16KZ+eZATLcAxFgMqS5gY7AcHJ2LHU\nQuv/Z6veIQCbANhPkC9wgI29AXCoNATDEPz3gTsmZG5UgNshtLv5qQzapyKL\nM0KU\r\n=gOXf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFp1RXch91t3WRRjJtfYY8C+ItFqDjdQqQCOoVSZ7rUrAiEAhHhs2awbac71RKFT5TexIfmv7cpm/6O7QNg8hC5ZOtI="}]},"maintainers":[{"email":"jackhanford@gmail.com","name":"hanford"}],"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.2_1588138920485_0.5647967590045269"},"_hasShrinkwrap":false},"5.0.3":{"name":"next-offline","version":"5.0.3","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~5.1.2","fs-extra":"~8.1.0","workbox-webpack-plugin":"^5.0.0"},"description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.3","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-c0UwdaPZPpFWB25pIaaTKeD6cbqWoTyJRThDF3wCOTcBIXubso9NGF0yZ7xSOlZWix1UFixcITdSAaMyg0Wh1g==","shasum":"99dfa8af54b34287618e8894494dbe3a719d0913","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.3.tgz","fileCount":7,"unpackedSize":20071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfow3JCRA9TVsSAnZWagAAsBsP/RhXQptIdFO24Aa7Qipw\nOn3fhi2Iw3AecOt0SW8TILPKuwsiznJTVDCdwRF6k+6k+wkgjMae68C0ws1d\nNKxJc07BqcDpdjMGCXmi4XnYbzAJQ54YDyoWbzKtuZ14kgz3ti1papZnnCp3\n4u4CD4Exki/Bc+YwhbzCzwlH0lCjCwcwNxShIacifzPtuOym5pxjksxlOKoZ\nJxksLvDiRTEM8Aa3KxRzyqzIKlWwUP7C6adCAMGh3HNcMOpa2UOL8LOrMulA\nKbfNL52TjVhylQrZC/R13MLJvh8j0cG+P16FnXQ5cDYiED3iSuP585vORaIa\nMXIwD4MbRNsdH4JoACKpHA4ChXjRrAt5pxFT0V6j3zTE+1Fhd2xPiUJw3jdO\nCNGYjcGNY8rTDkb5NFlw3HdN6tcdjxNAUf+NWZOxjJscF9C8fZMacljJdW9P\n28q9kLSVQv+f0msiZC1ckqJzdzqqXBJoomyW0dEWyGfe+KughWKQM42yHZ/e\nrFOFmNPidO/BwqylVdXxGCRhCsErAeSixk5KA41AuM8ul+IQFEbcckN2lj/h\n/WvEJvDZmLUvzCSBn2Q0ohWnPB9eq/V04fHwP5Ad4Q5dHbsXt58lb7CrOpCm\nrUCZC9XlzxlY/ZWxl3ZJAOs1GR3i0P2wxNBF2pBp0HAHIuAl7RMA9U8Cf1Av\nAtdT\r\n=XX1C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCE4CqfoARD4tcWUNGXCqThs2NTCnKDpLezd2GQUVxP3gIhAI780dq2xl/Meev58sfugKPFkVfsTpbt72NQwGPj2qwH"}]},"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"maintainers":[{"name":"hanford","email":"jackhanford@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.3_1604521416717_0.19433155745407138"},"_hasShrinkwrap":false},"5.0.4":{"name":"next-offline","version":"5.0.4","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"^6.4.1","fs-extra":"~8.1.0","workbox-webpack-plugin":"^5.0.0"},"description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.4","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-JqUI3N6Z5tzJc+Znj7jwOJ3j7fPYuTZnJ5hJ2REzliewvF81z6Df6VMcCN2W0p8jW5VQtIiSZSoLUdzWTiujNg==","shasum":"1c8382fbdba104d04fe868da9f28425d1538cf42","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.4.tgz","fileCount":7,"unpackedSize":20099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdb6ACRA9TVsSAnZWagAAfAAP/itMPsQp6PpFri8d6k/b\nHSfv1drSNoYc0OF5/BgoKc8miUHTa6y0t0lQDvzl4wWJ9utlKSETHB7QbJmB\nsemxFx5RKEw/zQ/O05JkJAHB+YemYkIItzIjCDrExGECVQNK3tf1C15BHa9h\ndgRIkd32HiZ0tyElV+JWPXyJTH0xvi2SN9Kl9cC6t8qSBDzKfeVdLcGDailJ\nmIlQr5yk14iS8xkqSKSm2cMF6uHgNQweEDwtoI32RmUQz6CrUzUWyMa1Q7Hj\nlvQssx8IrqCnMUmiLf/qAXsgb0rIDWMMdSUes39+3vy8QiyyKN0zSYnKbscD\nNPrwdf4mm4tS17tnhknwQC6ehQhKTczJQramLhaz/s+enJ8kvOITmle0ycU2\nOWCTcdBJBgFEn7qc/LV5AztX0V79pfrIdU5uAhacq/UwyowWzHcNk9Jsvbx7\nUXk7Sgjin87RPjbVPY1GkwXahvvmkG1NAkgckSdOYjAX478/70WSf49Yx+CE\n54iAeb/vymJN1P7cX8RdGpEH/zgO3O+xt0ljXo85VGTdO5PHdt4xxjATF/nD\nqnPMP9wpvcxs25poNWQ8ZUBwobMINnWtgwHicBC9hqj42qDz2daIVsA1QSvJ\nYgltNtcnyJZq65a3pgi+mH6NEDEnnxCvF5sHV2ietVqM2Zbc6Uap6xPdEcEO\nhVUV\r\n=v2RV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1/QaEdFfBNglKbh7c/IOS9sDeqxHT6V7WmaQGLASLggIgBlJpgYGK8KxapoB4dS/AhRHek6i7DRetq4CpHfPY/Lw="}]},"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"maintainers":[{"name":"hanford","email":"jackhanford@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.4_1618329215874_0.01690514151938416"},"_hasShrinkwrap":false},"5.0.5":{"name":"next-offline","version":"5.0.5","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"authors":["Jack Hanford"],"tags":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"peerDependencies":{"next":">=7.0.0","webpack":"^4.19.1"},"dependencies":{"copy-webpack-plugin":"~5.1.2","fs-extra":"~8.1.0","workbox-webpack-plugin":"^5.0.0"},"description":"<h1 align=\"center\">   next-offline </h1>","homepage":"https://github.com/hanford/next-offline#readme","_id":"next-offline@5.0.5","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-GOpq+mD7ecrgW+A8+Y31BLNca3b8EeyRMhW5C9PsCc/C2RO1AzrssgIgQIrRulFuXDvXuPE5hWI4/DTHeOUp6Q==","shasum":"91b2792f92a65e33eee00c9ab0dd1af9b9f71caa","tarball":"https://registry.npmjs.org/next-offline/-/next-offline-5.0.5.tgz","fileCount":7,"unpackedSize":20071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdcFtCRA9TVsSAnZWagAAC4oP/0gzqbqjy1N6L05UdcxN\nPkGf2Y3Y8BwVf23ormWhtW4wQK7OXQnrTqp07/NZjY7LmTQcTtWmXoqHKhfX\nk6RTDDRyfgvTb2HWgzvEBzZ/JkEbQWRBJ25+QCSZWDaP01U7eC15++NDrVVO\n2Lr1cyHPS+zyNIfr+APQut2W4mpgxwI4ZusvQE4/Ln6hK5lJIFPenenjMZLb\nCPr962xbcwXWIFS1Di/HifViku+0e07DkA8p3BBCBLuajjRgJo/AdbWfdIwQ\nEpndfa82FAlBW4VlJYlVvA9A56AVtLVZ+0buD6RfYbWeRnICy6SOZZk4iCjp\nwm06Ss+yq3bPFnT5bhxu8IDNz9rqYFcSNnlinJLVLqeL3t45fDxEUAKZERmV\ngdxGiUDyLPM4rjdkGvfEcxdJUc4bKDko+LpxWkz7meuOt8ICuCgTNyx1bGKb\nzT1RTQflIGLqCn2L6s4VPgO9LX5+/jwfGbP9hOyuW3MuIsL8y+8XeW/obFxL\nU+AXksOGE3hWN4tjeeL8Hwo99So+sYHeoXRqDh+bQlsGfiehharN7cONgKw8\nXIChmdLplprXGCeC+OQzBeXgdnm83FQR0YhJG7i8vFZLh0EH+Tgz63ezgjYL\nOKYGupsy1MSxaxYaJK+IefDpyYY8YKZ6rRFhf1uFMaNZbCaUa9dEt1vBdBP1\nc4iG\r\n=IpNI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNZ3hxYW0rbRYtvZK6kpzE92QBUdT+YLycyDfZ98FcsgIhANorlb7xUEBD/iqIB8JFYbhPJCh32JpwOZrO+Lmxgt3O"}]},"_npmUser":{"name":"hanford","email":"jackhanford@gmail.com"},"directories":{},"maintainers":[{"name":"hanford","email":"jackhanford@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-offline_5.0.5_1618329965096_0.9045775657015691"},"_hasShrinkwrap":false}},"time":{"created":"2018-02-07T18:18:52.560Z","0.0.1":"2018-02-07T18:18:52.670Z","modified":"2022-05-10T14:52:43.909Z","0.0.2":"2018-02-07T18:38:42.136Z","0.0.3":"2018-02-07T20:40:28.312Z","0.0.4":"2018-02-07T21:02:16.605Z","0.1.0":"2018-02-07T21:10:38.468Z","0.2.0-0":"2018-02-13T01:50:23.067Z","0.2.0-1":"2018-02-13T02:19:42.640Z","0.2.0-2":"2018-02-13T02:35:10.031Z","0.2.0-3":"2018-02-13T04:03:25.539Z","0.2.0-4":"2018-02-13T06:24:20.256Z","0.2.0-5":"2018-02-13T06:32:56.484Z","0.2.0-6":"2018-02-13T06:36:27.083Z","0.2.0-7":"2018-02-13T07:22:42.312Z","0.2.0-8":"2018-02-13T17:51:20.949Z","0.2.0-9":"2018-02-13T21:04:53.859Z","0.3.0":"2018-02-14T07:12:02.948Z","0.3.1":"2018-02-14T07:17:01.545Z","0.3.2":"2018-02-14T07:21:28.001Z","0.3.3":"2018-02-14T07:52:21.358Z","1.0.0":"2018-02-14T08:04:16.629Z","1.0.1":"2018-02-14T20:35:34.823Z","1.1.0":"2018-02-15T01:16:55.527Z","1.2.0":"2018-02-15T19:30:38.069Z","1.2.1":"2018-02-15T19:31:34.872Z","1.2.2":"2018-02-15T21:13:15.302Z","2.0.0":"2018-02-15T21:26:31.677Z","2.0.1":"2018-02-16T19:07:42.286Z","2.0.2":"2018-02-19T19:09:18.718Z","2.1.0":"2018-02-19T19:14:50.549Z","2.1.1":"2018-02-21T20:32:43.232Z","2.2.0":"2018-03-08T19:20:29.930Z","2.3.0-beta.1":"2018-03-26T07:05:35.417Z","2.3.0-beta.2":"2018-03-26T07:22:15.626Z","2.3.0-beta.3":"2018-03-26T07:29:05.981Z","2.3.0-beta.4":"2018-03-26T08:18:47.889Z","2.3.0-beta.5":"2018-03-26T16:58:49.936Z","2.3.0-beta.6":"2018-03-26T17:06:08.062Z","2.2.1-beta.0":"2018-03-27T16:42:07.560Z","2.2.1":"2018-03-27T16:45:20.305Z","2.3.0":"2018-03-29T16:50:25.532Z","2.3.1-beta.0":"2018-03-29T16:54:17.151Z","2.3.1":"2018-03-29T17:05:00.015Z","2.4.0":"2018-04-03T17:27:57.239Z","2.5.0":"2018-04-10T00:22:10.373Z","2.6.0":"2018-04-21T16:15:58.431Z","2.6.1-0":"2018-04-23T01:49:58.632Z","2.7.0":"2018-05-09T22:43:18.086Z","2.7.1":"2018-05-24T17:02:48.237Z","2.7.2":"2018-06-10T19:05:27.708Z","2.7.3":"2018-07-09T01:00:20.070Z","2.8.0":"2018-07-17T01:47:36.199Z","2.9.0":"2018-08-01T18:14:28.452Z","2.10.0":"2018-08-23T22:23:49.631Z","2.10.1":"2018-08-23T22:42:20.099Z","2.11.0":"2018-08-24T16:06:21.287Z","2.12.0":"2018-09-03T23:38:49.670Z","2.13.0":"2018-09-17T17:30:22.230Z","2.13.1":"2018-09-20T16:55:31.612Z","3.0.0-rc.0":"2018-09-21T20:19:59.323Z","3.0.0":"2018-09-21T20:29:04.082Z","2.13.2":"2018-09-24T16:36:13.611Z","3.0.1":"2018-09-24T16:58:27.519Z","3.0.2":"2018-10-04T15:49:55.892Z","3.0.3":"2018-10-23T03:56:37.704Z","3.0.4":"2018-11-01T00:44:55.718Z","3.0.6":"2018-11-11T00:08:32.819Z","3.0.7":"2018-11-11T00:11:58.162Z","3.0.8-beta.0":"2018-11-11T00:15:42.958Z","3.0.8":"2018-11-11T00:18:38.046Z","3.0.9-beta.0":"2018-11-11T00:34:26.914Z","3.0.9-beta.1":"2018-11-11T00:39:12.048Z","3.0.9-beta.2":"2018-11-11T00:45:50.048Z","3.0.9":"2018-11-11T00:52:45.721Z","3.0.9-beta.3":"2018-11-11T01:02:56.162Z","3.0.9-beta.4":"2018-11-11T01:04:00.921Z","3.0.9-beta.5":"2018-11-11T01:06:09.528Z","3.0.10":"2018-11-11T01:08:45.225Z","3.0.11-beta.0":"2018-11-16T16:51:00.267Z","3.1.0":"2018-11-16T17:04:48.569Z","3.2.0-beta.0":"2018-11-19T00:33:48.301Z","3.2.0-beta.1":"2018-11-19T03:07:08.149Z","3.2.0":"2018-11-19T16:59:39.421Z","3.2.1":"2018-11-19T17:10:47.502Z","3.2.2":"2018-11-26T16:44:29.815Z","3.3.0-beta.0":"2018-12-07T18:01:15.005Z","3.3.0":"2018-12-09T23:05:44.706Z","3.3.1":"2018-12-12T18:07:48.804Z","3.3.2":"2019-01-05T23:35:17.212Z","3.3.3":"2019-01-11T17:50:42.086Z","3.3.4":"2019-01-17T17:41:56.755Z","3.3.5":"2019-01-18T16:42:23.020Z","3.3.6-beta.0":"2019-02-28T17:29:02.867Z","3.3.6-beta.1":"2019-02-28T17:32:49.515Z","3.3.6":"2019-02-28T17:42:20.488Z","4.0.0-beta.0":"2019-03-05T00:12:10.641Z","3.3.7":"2019-03-22T15:55:22.332Z","3.3.8":"2019-04-11T00:32:56.164Z","3.4.0":"2019-05-08T16:35:59.145Z","4.0.0-beta.1":"2019-05-14T00:37:08.200Z","4.0.0":"2019-05-14T15:23:35.835Z","4.0.1":"2019-05-21T17:26:16.141Z","4.0.2-beta.0":"2019-06-03T15:32:37.665Z","4.0.2":"2019-06-03T15:39:46.838Z","5.0.0-alpha.0":"2019-07-23T18:13:57.058Z","5.0.0-beta.1":"2019-07-24T18:37:01.097Z","4.0.3":"2019-07-31T15:39:22.742Z","5.0.0-beta.2":"2019-08-05T02:47:28.086Z","5.0.0-beta.3":"2019-08-10T18:53:27.791Z","4.0.4":"2019-08-21T17:32:46.464Z","4.0.5":"2019-08-21T21:05:53.186Z","5.0.0-beta.4":"2019-08-23T00:43:15.073Z","5.0.0-beta.5":"2019-10-03T15:27:07.550Z","4.0.6":"2019-10-03T15:29:01.385Z","5.0.0-6.0":"2019-10-03T15:32:56.958Z","5.0.0-beta.6":"2019-10-03T15:34:17.017Z","5.0.0-beta.7":"2019-10-03T22:05:26.709Z","5.0.0-beta.8":"2019-10-24T15:31:07.194Z","5.0.0-beta.9":"2019-11-17T23:01:29.571Z","5.0.0-beta.10":"2019-11-17T23:27:06.384Z","5.0.0-beta.11":"2019-12-03T17:21:23.736Z","5.0.0":"2020-01-30T16:55:03.971Z","5.0.1":"2020-04-18T21:00:33.501Z","5.0.2":"2020-04-29T05:42:00.878Z","5.0.3":"2020-11-04T20:23:36.922Z","5.0.4":"2021-04-13T15:53:36.061Z","5.0.5":"2021-04-13T16:06:05.263Z"},"maintainers":[{"name":"hanford","email":"jackhanford@gmail.com"}],"homepage":"https://github.com/hanford/next-offline#readme","repository":{"type":"git","url":"git+https://github.com/hanford/next-offline.git"},"bugs":{"url":"https://github.com/hanford/next-offline/issues"},"license":"MIT","readme":"<h1 align=\"center\">\n  next-offline\n</h1>\n\n<p align=\"center\">\nUse <a href='https://github.com/GoogleChrome/workbox'>Workbox</a> with <a href='https://github.com/zeit/next.js'>\nNext.js</a> and <br />easily enable offline functionality in your application!\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/dy/next-offline.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/next-offline\">\n    <img src=\"https://img.shields.io/npm/v/next-offline.svg?maxAge=3600&label=next-offline&colorB=007ec6\">\n  </a>\n  <img src=\"https://img.shields.io/github/repo-size/hanford/next-offline.svg\" />\n</p>\n\n<br/>\n\n## Installation\n\n```sh\n$ npm install --save next-offline\n```\n\n```sh\n$ yarn add next-offline\n```\n\n## Usage\n\nThere are two important things to set up, first we need `next-offline` to wrap your next config.\n\nIf you haven't yet, create a `next.config.js` in your project.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  ...\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\nNext we need to make sure our the application is properly serving the service worker, this setup depends on how you're hosting your application. There is [documentation](#serving-service-worker) below. If you're not using Now 2.0, the Now 1.0 example should work in most circumstances.\n\n## Documentation\n- [Serving service worker](#serving-service-worker)\n  - [Now 1.0 / AWS](#now-10)\n  - [Now 2.0](#now-20)\n- [Registering service worker](#registering-service-worker)\n  - [compile-time registration](#compile-time-registration)\n  - [runtime registration](#runtime-registration)\n- [Customizing service worker](#customizing-service-worker)\n  - [Using workbox](#using-workbox)\n  - [next-offline options](#next-offline-options)\n- [Cache Strategies](#cache-strategies)\n- [Service worker path](#service-worker-path)\n- [next export](#next-export)\n- [Development mode](#development-mode)\n- [Next Offline 5.0](#next-offline-50)\n- [Contrbuting](#contributing)\n- [License](#license-(mit))\n\n## Serving service worker\nBecause service workers are so powerful, the API has some restrictions built in. For example, service workers must be served on the domain they're being used on - [you can't use a CDN](https://github.com/w3c/ServiceWorker/issues/940).\n\n### Now 1.0\nYou'll want to use the next.js custom server API. The easiest way to do that is creating a `server.js` that looks like this:\n```js\nconst { createServer } = require('http')\nconst { join } = require('path')\nconst { parse } = require('url')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\n\napp.prepare()\n  .then(() => {\n    createServer((req, res) => {\n      const parsedUrl = parse(req.url, true)\n      const { pathname } = parsedUrl\n\n      // handle GET request to /service-worker.js\n      if (pathname === '/service-worker.js') {\n        const filePath = join(__dirname, '.next', pathname)\n\n        app.serveStatic(req, res, filePath)\n      } else {\n        handle(req, res, parsedUrl)\n      }\n    })\n    .listen(3000, () => {\n      console.log(`> Ready on http://localhost:${3000}`)\n    })\n  })\n```\nYou can  read more about custom servers in the [Next.js docs](https://github.com/zeit/next.js#custom-server-and-routing)\n\nIf you're not hosting with Now, I'd probably follow the Now 1.0 approach because the custom server API can enable a lot of functionality, it just simply doesn't work well with Now 2.0 🙇‍♂️\n\n### Now 2.0\nBecause Now 2.0 works so different than the previous version, so does serving the service worker. There are a few different ways to do this, but I'd recommend checking out [this now2 example app](https://github.com/hanford/next-offline/tree/master/packages/now2-example). The changes to be aware of are in the [now.json](https://github.com/hanford/next-offline/blob/master/packages/now2-example/now.json) and [next.config.js](https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js).\n\n## Registering service worker\n### Compile-time registration\nBy default `next-offline` will register a service worker with the script below, this is automatically added to your client side bundle once `withOffline` is invoked.\n\n```js\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', function () {\n    navigator.serviceWorker.register('/service-worker.js', { scope: '/' }).then(function (registration) {\n      console.log('SW registered: ', registration)\n    }).catch(function (registrationError) {\n      console.log('SW registration failed: ', registrationError)\n    })\n  })\n}\n```\n\n### Runtime registration\nAlternative to compile-time, you can take control of registering/unregistering in your application code by using the `next-offline/runtime` module.\n\n```js\nimport { register, unregister } from 'next-offline/runtime'\n\nclass App extends React.Component {\n  componentDidMount () {\n    register()\n  }\n  componentWillUnmount () {\n    unregister()\n  }\n  ..\n}\n```\n\nIf you're handling registration on your own, pass `dontAutoRegisterSw` to next-offline.\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({ dontAutoRegisterSw: true })\n```\n\n## Customizing service worker\n\n### Using workbox\n\nIf you're new to workbox, I'd recommend reading this [quick guide](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) -- anything inside of `worboxOpts` will be passed to `workbox-webpack-plugin`.\n\nDefine a `workboxOpts` object in your `next.config.js` and it will gets passed to [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#generatesw_plugin). Workbox is what `next-offline` uses under the hood to generate the service worker, you can learn more about it [here](https://developers.google.com/web/tools/workbox/).\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nconst nextConfig = {\n  workboxOpts: {\n    ...\n  }\n}\n\nmodule.exports = withOffline(nextConfig)\n```\n\n### next-offline options\nOn top of the workbox options, next-offline has some options built in flags to give you finer grain control over how your service worker gets generated.\n\n<table>\n  <thead>\n    <tr>\n      <th>Name</th>\n      <th>Type</th>\n      <th>Description</th>\n      <th>Default</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>generateSw</td>\n      <td>Boolean</td>\n      <td>If false, next-offline will not generate a service worker and will instead try to modify workboxOpts.swSrc</td>\n      <td>true</td>\n    </tr>\n    <tr>\n      <td>dontAutoRegisterSw</td>\n      <td>Boolean</td>\n      <td>If true, next-offline won't automatically push the registration script into the application code. This is required if you're using runtime registration or are handling registration on your own.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>devSwSrc</td>\n      <td>String</td>\n      <td>Path to be registered by next-offline during development. By default next-offline will register a noop during development</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>generateInDevMode</td>\n      <td>Boolean</td>\n      <td>If true, the service worker will also be generated in development mode. Otherwise the service worker defined in devSwSrc will be used.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>registerSwPrefix</td>\n      <td>String</td>\n      <td>If your service worker isn't at the root level of your application, this can help you prefix the path. This is useful if you'd like your service worker on foobar.com/my/long/path/service-worker.js. This affects the [scope](https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope) of your service worker.</td>\n      <td>false</td>\n    </tr>\n    <tr>\n      <td>scope</td>\n      <td>String</td>\n      <td>This is passed to the automatically registered service worker allowing increase or decrease what the service worker has control of.</td>\n      <td>\"/\"</td>\n    </tr>\n  </tbody>\n</table>\n\n## Cache strategies\nBy default `next-offline` has the following blanket runtime caching strategy. If you customize `next-offline` with `workboxOpts`, the default behaviour will not be passed into `workbox-webpack-plugin`. This [article](https://developers.google.com/web/tools/workbox/guides/generate-service-worker/webpack#adding_runtime_caching) is great at breaking down various different cache recipes.\n```js\n{\n  runtimeCaching: [\n    {\n      urlPattern: /^https?.*/,\n      handler: 'NetworkFirst',\n      options: {\n        cacheName: 'offlineCache',\n        expiration: {\n          maxEntries: 200\n        }\n      }\n    }\n  ]\n}\n```\n\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  workboxOpts: {\n    runtimeCaching: [\n      {\n        urlPattern: /.png$/,\n        handler: 'CacheFirst'\n      },\n      {\n        urlPattern: /api/,\n        handler: 'NetworkFirst',\n        options: {\n          cacheableResponse: {\n            statuses: [0, 200],\n            headers: {\n              'x-test': 'true'\n            }\n          }\n        }\n      }\n    ]\n  }\n})\n```\n\n## Service worker path\nIf your application doesn't live on the root of your domain, you can use `registerSwPrefix`. This is helpful if your application is on domain.com/my/custom/path because by default `next-offline` assumes your application is on domain.com and will try to register domain.com/service-worker.js. We can't support using `assetPrefix` because service workers must be served on the root domain. For a technical breakdown on that limitation, see the following link: [Is it possible to serve service workers from CDN/remote origin?](https://github.com/w3c/ServiceWorker/issues/940)\n\nBy default `next-offline` will precache all the Next.js webpack emitted files and the user-defined static ones (inside `/static`) - essentially everything that is exported as well.\n\nIf you'd like to include some more or change the origin of your static files use the given workbox options:\n\n```js\nworkboxOpts: {\n  modifyUrlPrefix: {\n    'app': assetPrefix,\n  },\n  runtimeCaching: {...}\n}\n```\n\n## Development mode\nBy default `next-offline` will add a no-op service worker in development. If you want to provide your own pass its filepath to `devSwSrc` option. This is particularly useful if you want to test web push notifications in development, for example.\n\n```js\n// next.config.js\nconst withOffline = require('next-offline')\n\nmodule.exports = withOffline({\n  devSwSrc: '/path/to/my/dev/service-worker.js'\n})\n```\n\nYou can disable this behavior by setting the `generateInDevMode` option to `true`.\n\n\n## next export\n\nIn next-offline@3.0.0 we've rewritten the export functionality to work in more cases, more reliably, with less code thanks to some of the additions in Next 7.0.0!\n\nYou can read more about exporting at [Next.js docs]((https://github.com/zeit/next.js#static-html-export)) but next offline should Just Work™️.\n\n## next offline 5.0\nIf you're upgrading to the latest version of `next-offline` I recommend glancing at what's been added/changed inside of [Workbox in 5.x releases](https://github.com/GoogleChrome/workbox/releases) along with the 4.0 release which included the [breaking changes](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0). Next Offline's API hasn't changed, but a core dependency has!\n\n<hr />\n\nQuestions? Feedback? [Please let me know](https://github.com/hanford/next-offline/issues/new)\n\n## Contributing\n`next-offline` is a [lerna monorepo](https://lerna.js.org/)  which uses yarn workspaces. After cloning the repo, run the following\n\n```sh\n$ yarn bootstrap\n```\n\nThis will ensure your development version of next-offline is symlinked in the examples & tests which should allow you to quickly make changes!\n\n## License (MIT)\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\nCopyright © 2017-present [Jack Hanford](http://jackhanford.com), jackhanford@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","keywords":["react","next.js","offline","service worker","pre-cache","networkFirst","cacheFirst","webpack","workbox","sw-helpers"],"description":"<h1 align=\"center\">   next-offline </h1>"}