-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Staticfiles serving was implemented to leverage Django's new support_js_module_import_aggregation.
But I think it is not production ready yet. On my projects it is not working either.
Next, without support_js_module_import_aggregation
it could be very dangerous to provide 2 versions of JS module.
Assume this scenario:
django-vite
providesentrypoint.<vitehash>.<djangohash>
- Entrypoint imports more modules
- One of these modules imports entrypoint (circular). But, the reference is without
djangohash
becasue files were not processed by Django. So the entrypoint is re-evaluated and our app crash.
I think static files should be used only with support_js_module_import_aggregation
. So it make sense to introduce something like DJANGO_VITE_USE_STATICFILES
to be able to control it. Or even better to check if STATICFILES_STORAGE
has enabled support_js_module_import_aggregation
?
Btw. compression works in whitenoise
even if the file is served directly as original, entrypoint.<vitehash>
in our case.
sspross, bsimons, svengt, knokit, sjdemartini and 1 more
Metadata
Metadata
Assignees
Labels
No labels