Skip to content

Commit

Permalink
Use assetPathResolver closure if set (#1221)
Browse files Browse the repository at this point in the history
The original Vite Facade uses the assetPathResolver closure (if set) to generate assets with a custom URL. This is needed when for example assets are cached on a CDN, or if you need assets from a central URL while in Tenant context.

This updates the Tenancy version of the Vite-Facade to bring back the assetPathResolver logic.
  • Loading branch information
bbredewold committed May 13, 2024
1 parent 4dab0c1 commit 120b8bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Vite.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class Vite extends BaseVite // todo move to a different directory in v4
*/
protected function assetPath($path, $secure = null)
{
return global_asset($path);
return $this->assetPathResolver ? ($this->assetPathResolver)($path, $secure) : global_asset($path);
}
}

0 comments on commit 120b8bc

Please sign in to comment.