@@ -385,7 +385,11 @@ async function write_assets_json(metafile) { | |||||
let info = metafile.outputs[output]; | let info = metafile.outputs[output]; | ||||
let asset_path = "/" + path.relative(sites_path, output); | let asset_path = "/" + path.relative(sites_path, output); | ||||
if (info.entryPoint) { | if (info.entryPoint) { | ||||
out[path.basename(info.entryPoint)] = asset_path; | |||||
let key = path.basename(info.entryPoint); | |||||
if (key.endsWith('.css') && asset_path.includes('/css-rtl/')) { | |||||
key = `rtl_${key}`; | |||||
} | |||||
out[key] = asset_path; | |||||
} | } | ||||
} | } | ||||
@@ -170,10 +170,10 @@ frappe.assets = { | |||||
bundled_asset(path, is_rtl=null) { | bundled_asset(path, is_rtl=null) { | ||||
if (!path.startsWith('/assets') && path.includes('.bundle.')) { | if (!path.startsWith('/assets') && path.includes('.bundle.')) { | ||||
path = frappe.boot.assets_json[path] || path; | |||||
if (path.endsWith('.css') && is_rtl) { | if (path.endsWith('.css') && is_rtl) { | ||||
path = path.replace('/css/', '/css-rtl/'); | |||||
path = `rtl_${path}`; | |||||
} | } | ||||
path = frappe.boot.assets_json[path] || path; | |||||
return path; | return path; | ||||
} | } | ||||
return path; | return path; | ||||
@@ -75,9 +75,6 @@ def include_script(path): | |||||
def include_style(path, rtl=None): | def include_style(path, rtl=None): | ||||
path = bundled_asset(path) | path = bundled_asset(path) | ||||
if is_rtl(rtl): | |||||
path = path.replace('/css/', '/css-rtl/') | |||||
return f'<link type="text/css" rel="stylesheet" href="{path}">' | return f'<link type="text/css" rel="stylesheet" href="{path}">' | ||||
@@ -87,9 +84,9 @@ def bundled_asset(path, rtl=None): | |||||
if ".bundle." in path and not path.startswith("/assets"): | if ".bundle." in path and not path.startswith("/assets"): | ||||
bundled_assets = get_assets_json() | bundled_assets = get_assets_json() | ||||
path = bundled_assets.get(path) or path | |||||
if path.endswith('.css') and is_rtl(rtl): | if path.endswith('.css') and is_rtl(rtl): | ||||
path = path.replace('/css/', '/css-rtl/') | |||||
path = f"rtl_{path}" | |||||
path = bundled_assets.get(path) or path | |||||
return abs_url(path) | return abs_url(path) | ||||