/* Build-time service worker injection. After Vite writes the bundle, the hashed asset URLs referenced by dist/index.html and a content-derived revision are written into dist/sw.js, so the offline shell is complete right after install and every release ships a new worker with fresh caches. Build tooling only — never imported by the app bundle. */ import { createHash } from "node:crypto"; import { readFileSync, writeFileSync } from "node:fs"; import { resolve } from "node:path"; import type { Plugin } from "vite"; export const REVISION_MARKER = "__NQ_BUILD_REVISION__"; const PRECACHE_PLACEHOLDER = "const PRECACHE_ASSETS = [];"; // Every same-origin URL an index.html loads via