mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
Archive commit
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
const { hash } = require('./src/ts/generated/hash.json');
|
||||
const ignore = /^\/((a(pi(\d?|-tools)|uth|dm(in)?)|(bl|m)ep)|tools|reload)\/|\.html|^\/sw\.js$/;
|
||||
|
||||
module.exports = {
|
||||
globDirectory: 'build/',
|
||||
globPatterns: [
|
||||
'**/*.{js,css,png,jpg,wasm}',
|
||||
],
|
||||
globIgnores: [
|
||||
'**/assets-admin/**',
|
||||
'**/bootstrap-es*',
|
||||
'**/bootstrap-tools*',
|
||||
'**/style-tools*',
|
||||
'**/style-inline*',
|
||||
'**/sw.min.js',
|
||||
],
|
||||
dontCacheBustURLsMatching: /-[a-f0-9]{10}\./,
|
||||
swDest: 'build/sw.js',
|
||||
navigateFallback: '/',
|
||||
navigateFallbackBlacklist: [ignore],
|
||||
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024, // 10 MB
|
||||
// importWorkboxFrom: 'local',
|
||||
skipWaiting: true,
|
||||
clientsClaim: true,
|
||||
templatedURLs: {
|
||||
'/': hash,
|
||||
},
|
||||
directoryIndex: '/',
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: ignore,
|
||||
handler: 'NetworkOnly',
|
||||
},
|
||||
{
|
||||
urlPattern: /^\/assets\/music/,
|
||||
handler: 'CacheOnly',
|
||||
options: {
|
||||
cacheName: 'music-cache',
|
||||
expiration: {
|
||||
maxAgeSeconds: 1000 * 3600 * 24 * 30, // 30 days
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user