Use clients claim and skip waiting to make sure that service worker takes over the window on the initial load (not just subsequent refreshes).

See https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle.
This commit is contained in:
Dillon Kearns 2019-09-17 14:14:44 -07:00
parent 5cd1443d17
commit 2e7a65bf1b

View File

@ -190,6 +190,8 @@ function webpackOptions(production, routes, { debug, manifestConfig }) {
}
}),
new GenerateSW({
skipWaiting: true,
clientsClaim: true,
include: [
/^index\.html$/,
/\.js$/,