Skip to content

Latest commit

 

History

History
 
 

next-9

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

next-pwa - next.js 9+ example

[TOC]

This example demonstrates how to use next-pwa plugin to turn a next.js based web application into a progressive web application easily.

Thanks to Next.js 9+, we can use public folder to serve static files from root url path. It cuts the need to write custom server only to serve those files. Therefore the setup is more easy and concise. We can use next.config.js to config next-pwa to generates service worker and precache files into public folder.

Check out the lighthouse summary, or run the test your self.

Usage

Open in Gitpod

cd examples/next-9
yarn install
yarn build
yarn start

Recommend .gitignore

**/public/workbox-*.js
**/public/sw.js