This commit is contained in:
2026-04-29 07:39:29 +02:00
parent 41a5472582
commit b866845b6a
40 changed files with 71735 additions and 111 deletions

View File

@@ -0,0 +1,17 @@
import { readFile, writeFile } from 'node:fs/promises';
import { resolve } from 'node:path';
const swPath = resolve(process.cwd(), 'public', 'sw.js');
const buildStamp = `${Date.now()}`;
const source = await readFile(swPath, 'utf8');
const next = source.replace(
/const CACHE_NAME = 'radioplayer-pwa-v5(?:-[^']+)?';/,
`const CACHE_NAME = 'radioplayer-pwa-v5-${buildStamp}';`,
);
if (next === source) {
throw new Error('Failed to update service worker cache version.');
}
await writeFile(swPath, next, 'utf8');