Skip to content
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

Enable javascript import replacements for ManifestStaticFilesStorage #1954

Merged
merged 2 commits into from
Jun 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion evap/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import sys
from typing import Any, List, Tuple

from django.contrib.staticfiles.storage import ManifestStaticFilesStorage

BASE_DIR = os.path.dirname(os.path.realpath(__file__))


Expand Down Expand Up @@ -133,12 +135,17 @@
},
}


class ManifestStaticFilesStorageWithJsReplacement(ManifestStaticFilesStorage):
support_js_module_import_aggregation = True


STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage",
"BACKEND": "evap.settings.ManifestStaticFilesStorageWithJsReplacement",
},
}

Expand Down