From c442c6b439c52a7a6d16855a6166052b4e22aed2 Mon Sep 17 00:00:00 2001 From: Richard Ebeling Date: Mon, 22 May 2023 18:54:49 +0200 Subject: [PATCH 1/2] Enable javascript import replacements for ManifestStaticFilesStorage --- evap/settings.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evap/settings.py b/evap/settings.py index e1f0844607..54ebc7b974 100644 --- a/evap/settings.py +++ b/evap/settings.py @@ -133,12 +133,16 @@ }, } +from django.contrib.staticfiles.storage import ManifestStaticFilesStorage +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", }, } From c2ee51118aa569bc374dcd5a61e57deb2460c883 Mon Sep 17 00:00:00 2001 From: Richard Ebeling Date: Mon, 5 Jun 2023 20:00:31 +0200 Subject: [PATCH 2/2] format --- evap/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/evap/settings.py b/evap/settings.py index 54ebc7b974..7902c2d213 100644 --- a/evap/settings.py +++ b/evap/settings.py @@ -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__)) @@ -133,10 +135,11 @@ }, } -from django.contrib.staticfiles.storage import ManifestStaticFilesStorage + class ManifestStaticFilesStorageWithJsReplacement(ManifestStaticFilesStorage): support_js_module_import_aggregation = True + STORAGES = { "default": { "BACKEND": "django.core.files.storage.FileSystemStorage",