Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/grvpanchal/pwa-webpack

This is a blank PWA setup providing 100% result under Chrome Lighthouse audit
https://github.com/grvpanchal/pwa-webpack

Last synced: 21 days ago
JSON representation

This is a blank PWA setup providing 100% result under Chrome Lighthouse audit

Awesome Lists containing this project

README

        

# PWA Webpack Sample
This is a blank PWA setup providing 100% result under Chrome Lighthouse audit

PWA lighthouse best results

## Prerequisites

- nodejs: https://nodejs.org
- mkcert: https://github.com/FiloSottile/mkcert
- yarn: ``npm i -g yarn``

## Setup
If you havent already installed mkcert for browser then run
```
mkcert -install
```

Re-open the chrome browser to enable the installed certificates.

Create a certificate for localhost domain

```
mkcert localhost
```

You will see a result similar as below

Intall Certificate results

Copy the path of local CA and update your webpack.config.js. Remeber to add `rootCA.pem` at end of root CA path
```js
https: {
key: fs.readFileSync('./localhost-key.pem'),
cert: fs.readFileSync('./localhost.pem'),
ca: fs.readFileSync('/home/{user-home}/.local/share/mkcert/rootCA.pem')
},
```

Install the modules
```sh
$ yarn install
```

### STOP ALL LOCAL SERVERS ON PORT 80, 8080 AND 443

Start the project with HTTP 2.0
```sh
$ yarn start
```

Start the project for PWA Score
```sh
$ sudo yarn start:pwa
```
Go to Chrome and open https://localhost with developers tool. Go to Audits tab and hit `Run audits`

PWA audit Init

## Final Result

You will see a result similar to below image for HTTP2 `yarn start`

PWA audit Result

View the perfect PWA score with `sudo yarn start:pwa`
PWA audit Result