Skip to content

Commit

Permalink
Merge pull request #6 from PerchunPak/patch-1
Browse files Browse the repository at this point in the history
Do not load `.css` files if they don't exist
  • Loading branch information
thismatters authored Mar 16, 2023
2 parents d895ca6 + fe103e2 commit fc8ee23
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions django_svelte/templatetags/django_svelte.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from os import path
from django import template
from django.contrib.staticfiles.storage import staticfiles_storage

Expand All @@ -18,4 +19,8 @@ def display_svelte(component, component_props={"name": "world"}):
"app_name": app_name,
"props": component_props,
}

if not path.exists(context["css_bundle_url"]):
context.pop("css_bundle_url")

return context

0 comments on commit fc8ee23

Please sign in to comment.