-
Notifications
You must be signed in to change notification settings - Fork 0
/
workbox-config.js
33 lines (32 loc) · 1.25 KB
/
workbox-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* Copyright (c) Nathan Bolton (GPL-3.0 OR MPL-2.0) | https://github.com/thinknathan/web-app-starter-project */
const isDev = process.env.NODE_ENV === 'development';
// https://developer.chrome.com/docs/workbox/reference/workbox-build/#type-GenerateSWOptions
module.exports = {
// https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim
clientsClaim: true,
globIgnores: [
'**/robots.txt',
'**/humans.txt',
'**/google*.html', // google verification
'**/browserconfig.xml', // ms config
'**/*.map', // source maps
'**/apple-icon-*.png', // apple icons
'**/apple-splash-*.png', // apple splash screens
'**/mstile-icon-*.png', // ms tiles
'**/manifest-icon-*.png', // android icons
'**/service-worker.js', // service worker itself
'**/styles/*.js', // js files in the styles folder
],
globDirectory: './www/',
globPatterns: [
'**/*.{avif,caf,css,csv,eot,gif,html,ico,jpg,jpeg,js,json,jxl,mp3,m4a,ogg,opus,otf,png,svg,ttf,txt,webmanifest,woff,woff2,webm,webp,xml}',
],
globFollow: true,
globStrict: true,
maximumFileSizeToCacheInBytes: 5000000,
mode: process.env.NODE_ENV,
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/skipWaiting
skipWaiting: false,
sourcemap: isDev,
swDest: './www/service-worker.js',
};