hackernews-react-graphql icon indicating copy to clipboard operation
hackernews-react-graphql copied to clipboard

Add sw-precache, register serviceWorker

Open matthiaskern opened this issue 8 years ago • 0 comments

Looking at #6, I decided to go ahead and try sw-precache.

The plugin doesn't actually cache anything while webpack in compile-time, but is caching runtime and returning cached assets when the app is offline.

The service worker get's registered only in the index route, but should consider if it would be better to do globally.

I also added NODE_ENV=production flag for the build step, as otherwise the next app was not build with production mode for me locally. I tested this with npm start afterwards, and it included webpack-hmr requests.

matthiaskern avatar Oct 03 '17 20:10 matthiaskern