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
use generateSW and injectManifest (note lower case)
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 compileservice-worker.js
. The PR solves this by configuring webpack withworkbox-webpack-plugin
code.BREAKING CHANGES
generateSW
andinjectManifest
(note lower case)