Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back assetPathResolver closure if set in Tenancy Vite Facade #1221

Merged
merged 1 commit into from
May 13, 2024

Conversation

bbredewold
Copy link
Contributor

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.

Example usage from Laravel docs:

{{
  Vite::withEntryPoints(['resources/js/app.js']) // Specify the entry points...
    ->createAssetPathsUsing(function (string $path, ?bool $secure) { // Customize the backend path generation for built assets...
        return "https://cdn.example.com/{$path}";
    })
    ->toHtml()
}}

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.
@stancl stancl merged commit 120b8bc into archtechx:3.x May 13, 2024
3 checks passed
@stancl
Copy link
Member

stancl commented May 13, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants