diff --git a/README.md b/README.md index 9ef623b..e3953e0 100644 --- a/README.md +++ b/README.md @@ -374,13 +374,11 @@ If you are serving your static files with whitenoise, by default your files comp ```python import re -# Vite generates files with 8 hash digits # http://whitenoise.evans.io/en/stable/django.html#WHITENOISE_IMMUTABLE_FILE_TEST def immutable_file_test(path, url): - # Match filename with 12 hex digits before the extension - # e.g. app.db8f2edc0c8a.js - return re.match(r"^.+[\.\-][0-9a-f]{8,12}\..+$", url) + # Match vite (rollup)-generated hashes, à la, `some_file-CSliV9zW.js` + return re.match(r"^.+[.-][0-9a-zA-Z_-]{8,12}\..+$", url) WHITENOISE_IMMUTABLE_FILE_TEST = immutable_file_test