Webpack loader's emitFile call takes a 4th param that can provide additional info about an asset, like whether it is immutable or not. file-loader should pass in { immutable: true } when the file name includes [contenthash] so that other plugins can benefit from this info.
Feature Proposal
Webpack loader's emitFile call takes a 4th param that can provide additional info about an asset, like whether it is immutable or not.
file-loader
should pass in{ immutable: true }
when the file name includes[contenthash]
so that other plugins can benefit from this info.The new
assetInfo
param was added in https://github.com/webpack/webpack/issues/9038.Feature Use Case
I'm writing a plugin that uses this info to determine what cache-control headers a file can be given.