├── .gitignore ├── README.md ├── components └── nav.js ├── package.json ├── pages └── index.js ├── public └── favicon.ico └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | .env* 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # next-js-pwa-create-next-app 2 | NextJS + PWA with create-next-app 3 | 4 | Full article on Medium : 5 | https://medium.com/@eshwaren/pwa-with-next-js-create-next-app-in-2020-%EF%B8%8F-9ee0e1a6313d 6 | -------------------------------------------------------------------------------- /components/nav.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Link from 'next/link' 3 | 4 | const links = [ 5 | { href: 'https://zeit.co/now', label: 'ZEIT' }, 6 | { href: 'https://github.com/zeit/next.js', label: 'GitHub' }, 7 | ].map(link => ({ 8 | ...link, 9 | key: `nav-link-${link.href}-${link.label}`, 10 | })) 11 | 12 | const Nav = () => ( 13 | 54 | ) 55 | 56 | export default Nav 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "next-pwa-medium", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start" 9 | }, 10 | "dependencies": { 11 | "next": "9.2.1", 12 | "react": "16.12.0", 13 | "react-dom": "16.12.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pages/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Head from 'next/head' 3 | import Nav from '../components/nav' 4 | 5 | const Home = () => ( 6 |
7 | 8 | Home 9 | 10 | 11 | 12 |
86 | ) 87 | 88 | export default Home 89 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skolhustick/next-js-pwa-create-next-app/66a9e2ca45b6c83018dbea2b137f68ae275c1719/public/favicon.ico --------------------------------------------------------------------------------