fix: Make bundled asset URL absolute always

This commit is contained in:
Faris Ansari 2021-05-20 20:22:14 +05:30
parent ed5ca19233
commit 16ff2de946

View file

@ -81,9 +81,10 @@ def include_style(path):
def bundled_asset(path):
from frappe.utils import get_assets_json
from frappe.website.utils import abs_url
if path.startswith("/assets") or ".bundle." not in path:
return path
if ".bundle." in path and not path.startswith("/assets"):
bundled_assets = get_assets_json()
path = bundled_assets.get(path) or path
bundled_assets = get_assets_json()
return bundled_assets.get(path) or path
return abs_url(path)