Document runtime exclusions and verify offline transfer savings

This commit is contained in:
Jonathan Sykes
2026-10-09 14:56:31 +08:00
parent dd09f66578
commit 8a4144eb00
11 changed files with 22411 additions and 3 deletions

View File

@@ -55,7 +55,6 @@ export function createAssetManifest(publicDir = './public', { hashing = true, bu
else {
const content = readFileSync(path);
bytes.set(url, content);
}
}
}
@@ -91,7 +90,7 @@ export function createAssetManifest(publicDir = './public', { hashing = true, bu
const swSource = bytes.get('/sw.js')?.toString() ?? null;
// Derived build metadata cannot be an input to its own hash. Canonicalize
// the index meta and SW injected tag, then publish hashes of the final bytes.
// All original bytes (including index/SW source) remain inputs via source hashes.
// All runtime source bytes (including index/SW source) remain inputs via source hashes.
let canonicalIndex = source === null ? null : stampIndex(embedAssets(source, files, groups, '__BUILD_TAG__', hashing), files, { hashing });
const canonical = { assetSync, files: { ...files }, groups, contracts };
if (canonicalIndex !== null && hashing) canonical.files['/index.html'] = { ...files['/index.html'], h: assetHash(canonicalIndex), s: Buffer.byteLength(canonicalIndex), source: files['/index.html'].h };