AllanChain / gridsome-plugin-pwa

Yet another PWA plugin for Gridsome.
MIT License
7 stars 0 forks source link

Use workbox-build to precache non-asset files #11

Closed AllanChain closed 4 years ago

AllanChain commented 4 years ago

There are problems when using workbox-webpack-plugin to generate precache manifest with gridsome, because gridsome generates html and json files after bundling, which means we cannot get exact revision of these files.

Although it is not recommended to precache all files, there are needs to precache important files, such as /index.html (#9)

However, workbox-build does not compile service-worker.js. The PR solves this by configuring webpack with workbox-webpack-plugin code.

BREAKING CHANGES