-
Notifications
You must be signed in to change notification settings - Fork 12
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
Manifest has leading slash, but staticfiles expects none #54
Comments
I think that this can be fixed by changing However, is there any scenario in which the slash in absent? Otherwise I can't imagine how django-manifest-loader would ever work in non-DEBUG mode. |
Actually, the fact that django-manifest-loader uses staticfiles as a backend is problematic (and I realise that's what I was trying to avoid by switching to lib). The hashes added by ManifestStaticFilesStorage imply that js files loaded by js files will have mismatching filesnames. I actually need filenames to remain unchanged, so using staticfiles as a backend is a no-go. I guess I need to use a custom loader? https://django-manifest-loader.readthedocs.io/en/latest/docs/usage.html?highlight=loader#activating-the-custom-loader |
Oh, it's not the loader that delegates to staticfiles, but the I'm failing to understand how this library is meant to be used. Staticfiles itself adds hashes to scripts, so if one script refers to another, the path doesn't match and it won't load. I currently work around this by compiling everything into one single file (with no hash in its filename) that doesn't load other files, but this has multiple issues (caching is a mess, can't split into multiple script files). I realised I can use But it doesn't seem possible to avoid using staticfiles as a backend? So only running with |
you may need: ...
output: {
publicPath: 'auto',
},
... in the webpack config. |
Trying to use this in non-debug mode fails:
From what I can tell, the issue is that django-manifest-loader attempts to find files in the staticfiles stoage using the path found in
manifest.json
. The issue is that paths inmanifest.json
have a leading slash, but paths instaticfiles.json
do not.E.g.:
The text was updated successfully, but these errors were encountered: