Skip to content

Commit

Permalink
update webpack_manifest ctx_processor, re #11670
Browse files Browse the repository at this point in the history
  • Loading branch information
whatisgalen committed Jan 12, 2025
1 parent 7deb3e7 commit 260737c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions arches/app/utils/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,19 @@ def webpack_manifest(request):
"""
Loads the webpack manifest.json and adds it to the template context.
"""
manifest_path = os.path.join(
settings.STATIC_ROOT, settings.STATIC_URL, "build", "manifest.json"
)
manifest_path = os.path.join(settings.APP_ROOT, "media/build", "manifest.json")
manifest = {}

logger.warning(f"Looking for manifest.json at: {manifest_path}")

if os.path.exists(manifest_path):
with open(manifest_path, "r") as f:
manifest = json.load(f)
try:
with open(manifest_path, "r") as f:
manifest = json.load(f)
logger.warning(f"Loaded manifest.json with {len(manifest)} entries.")
except json.JSONDecodeError:
logger.error("Failed to decode manifest.json.")
else:
logger.warning("Webpack manifest not found at %s", manifest_path)
logger.warning(f"Manifest file not found at {manifest_path}.")

return {"webpack_manifest": manifest}
return manifest

0 comments on commit 260737c

Please sign in to comment.