CompactHashedChunkIdsPlugin
CompactHashedChunkIdsPlugin hashes chunk contents and assigns the shortest available prefix of each encoded hash. Compared with deterministic, it produces more compact ids that preserve stability while reducing bundle size and improving runtime indexing performance. Every character uses 0-9a-z, making chunk ids safe for case-insensitive file systems. An id is extended only when its shorter prefix is already used.
CompatHashedChunkIdsPlugin was available in Rspack 2.2.0. It is deprecated and was renamed to CompactHashedChunkIdsPlugin in Rspack 2.2.1. The old name remains available as a compatibility alias.
optimization.chunkIds: 'compact-hashed' uses this plugin internally. Add the plugin manually when you need to customize its options.
Examples
Options
minLength
- Type:
number - Default:
1 - Range: Integer from
1to13
The minimum encoded id length. Rspack extends an id one character at a time when its hash prefix is already used. Increasing minLength expands the initial id space, reducing prefix collisions and making generated output and caching more stable. The tradeoff is that chunk ids become longer.
salt
- Type:
number - Default:
0
The hash salt used when generating ids. Change this value to try a different hash starting value in the same id space.

