Skip to content

Commit 120b8bc

Browse files
authored
Use assetPathResolver closure if set (#1221)
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.
1 parent 4dab0c1 commit 120b8bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Vite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class Vite extends BaseVite // todo move to a different directory in v4
1515
*/
1616
protected function assetPath($path, $secure = null)
1717
{
18-
return global_asset($path);
18+
return $this->assetPathResolver ? ($this->assetPathResolver)($path, $secure) : global_asset($path);
1919
}
2020
}

0 commit comments

Comments
 (0)