Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Pass additional assetInfo object when calling emitFile #382

Closed
bschlenk opened this issue Aug 25, 2020 · 2 comments
Closed

Pass additional assetInfo object when calling emitFile #382

bschlenk opened this issue Aug 25, 2020 · 2 comments

Comments

@bschlenk
Copy link
Contributor

  • Operating System: MacOS
  • Node Version: 12.6.1
  • NPM Version: 6.14.7
  • webpack Version: 4.29.6
  • file-loader Version: 3.0.1

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 webpack/webpack#9038.

Feature Use Case

I'm writing a plugin that uses this info to determine what cache-control headers a file can be given.

@alexander-akait
Copy link
Member

Let's do it

@alexander-akait
Copy link
Member

Fixed by #383

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants