Adjust Vite config to not hash dynamic imports
What does this MR do and why?
Adjusts Vite config to not hash filenames for dynamic imports.
This is an attempt to work around this issue with Pages cache getting out of sync after deploys: gitlab-org/gitlab-pages#1140 (comment 2478573414)
Immediately after deploys, we've been seeing 404s on some of these dynamically-named files. The HTML pages seem to be looking for files from the last build, but those files no longer exist. After a few minutes, this clears up. Here's an example from earlier today:
If we don't change the filenames with each build, this will hopefully be less noticeable to visitors.
This only affects file chunks, not files we directly reference from templates (which do not have dynamic filenames), so we only need to adjust Vite config here.
Screenshots, screen recordings, or links to review app
No user-facing changes, this just impacts filenames in the build:
| before | after (no hashed filenames) |
|---|---|
|
|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Configure a local GitLab Docs environment.
- Check out this branch.
- Run
make viewand browse around. Site should look the same as production.
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.


