The standard solution is to have small top-level HTML files with short expiration (or no caching at all), then all the other assets (CSS, JS, images) have content-hashed filenames and are cached indefinitely.
I design and architect things specifically for the purpose they serve. What you describe, while popular and workable is putting the horse behind the carriage.
Vite gives you that behaviour out of the box.