mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #754] Support experimental.outputHashSalt config option and NEXT_HASH_SALT env var #166
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#166
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @github-actions[bot] on GitHub (Apr 2, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/754
Upstream change
Next.js added
experimental.outputHashSalt(config) andNEXT_HASH_SALT(env var) to mix a user-supplied string into content-addressed output hashes for chunks and static assets. When set, all output filenames change without modifying source code — useful for cache-busting after CDN poisoning or across deployments.When both are set, the values are concatenated:
outputHashSalt + NEXT_HASH_SALT.Commit:
github.com/vercel/next.js@3e0158846ePR: https://github.com/vercel/next.js/pull/91871
What changed upstream
experimental.outputHashSaltoption inExperimentalConfig(validated via zod in config-schema)NEXT_HASH_SALTenv var supportNextConfigComplete.hashSalt = (experimental.outputHashSalt ?? '') + (NEXT_HASH_SALT ?? '')output.hashSaltand to thenext-image-loader(prepends salt to image content before hashing)ProjectOptions.hashSaltinto chunking contexts, usesdeterministic_hash_with_saltfor single-pass hashingWhat vinext needs
vinext uses Vite/Rolldown for bundling, so the implementation path differs:
experimental.outputHashSaltin the vinext config layer andNEXT_HASH_SALTenv var. Compute the effective salt the same way (configSalt + envSalt).output.hashSaltor similar — if not, a customgenerateBundlehook could rename outputs.Priority
Low — this is an advanced deployment escape hatch, not a common user-facing feature. Track for config parity.