Open foarsitter opened 3 years ago
Hi,
I would like to support the idea of referencing the hashed files in CSS / JS files. Does the Django approach end up doing a find / replace in the final bundled CSS / JS files afterwards instead of depending on a dynamic lookup like the Jinja template approach is doing with a custom helper?
My approach would be a find and replace since its a straightforward solution. Also, I'm not aware of the other approach you refer to.
The other approach is how this extension works for Jinja templates. A new template function exists that's aware of the cache manifest file and does the lookup for the human readable file name to the hashed file name.
When an image is referenced from a css file it references to the unhashed version of the file. This could lead to issues when the referenced file is updated.
Django has this behavior implemented so we can use there patterns for replacing references in .css and .js files.
If this feature is wanted I will provide a pull request.