Including content hashes in URLs is beneficial for effective caching, however there are certain resources that should not have hashed URLs. Files like
index.html and Service Workers can't have hashes in their URLs, because their URLs must always remain the same.
This test builds multiple resources with configuration to control URL hashing for each. It assesses whether a build tool can selectively hash URLs for specific assets, entry bundles and code-splitted bundles.
import hashedUrl from './hashed-asset.txt'; import unhashedUrl from './unhashed-asset.txt'; console.log(hashedUrl, unhashedUrl); import('./hashed-chunk.js'); import('./unhashed-chunk.js');
Bundling both entries modules should produce 6 files. The 3 files with "hashed" in their names should generate hashed URLs, whereas the 3 files with "unhashed" in their names should generate URLs with no hashes.