-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible to use file hashes in query strings instead of file name #5825
Comments
I don't think |
@bluwy Thanks for the input! Absolutely agree with you, although what's frustrating is that one doesn't always have complete control over the deployment chain / environment policies. Anyway, you're right that this is the domain of a custom plugin, and it was really quite easy to implement once I did a bit more research:
...along with
|
@rubjo Hi. I faced the same problem and came up with the same implementation. Example: In import{C as e,D as t,E as o}from"./index.js"; The following is a section. import{C as e,D as t,E as o}from"./index.js?v=87654321"; If I don't do the above, it will refer to the old cached index.js. Have you faced this kind of problem? |
Ah hm, no (or maybe I have actually faced it without realising it 😄). I'm not immediately sure what to do in that case. |
Understood. |
Clear and concise description of the problem
In our environment, there's a specific whitelist for files permitted to be served. At the same time, I'd like to employ hashes to serve the most recent versions of the files.
I'd like to use hashes as query strings (eg.
fileX.js?v=87654321
) instead of part of the file name (fileX.87654321.js
), as that won't necessitate an update of the whitelist.Updating the config with eg.
build.rollupOptions.output.assetFileNames
toassets/[name].[ext]?v=[hash]
will just literally append?v=87654321
to the actual file name.Suggested solution
Config option (maybe it already exists in some form)
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: