-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
So there is a public folder option in vite build that does not create any entries, but you can still reference entries off of the root. https://vitejs.dev/guide/assets#the-public-directory
In my template I still want to reference these items by using the vite_asset_url
function.
<link rel="apple-touch-icon" href="{{ vite_asset_url('site-images/site/apple-touch-icon.png') }}">
So my way around this was to add a configuration of public_folder_passthrough
. I don't know a better name or if this is even the correct path, but I updated the ManifestClient.get()
method to make a pass through entry if it fails to find it in the manifest.json.
if path not in self._entries:
if self._config.public_folder_passthrough:
return ManifestEntry(
file=path,
src=path,
isEntry=True,
)
else:
raise DjangoViteAssetNotFoundError(
f"Cannot find {path} for app={self.app_name} in Vite manifest at "
f"{self.manifest_path}"
)
I am not sure if there is a better way, but this works exactly as expected once I added the passthrough for the public assets
andyabih, UdjinK, scottqueen-bixal, petrprikryl, tchappui and 1 more
Metadata
Metadata
Assignees
Labels
No labels