[9.x] Adding option for custom manifest filename on Vite Facade#45007
Conversation
|
In response to this issue: #45002 |
|
Hey @ngstwr, Thanks for the PR. I've tweaked the implementation slightly. In a global service provider, route based middleware, or inline in a view, you may now specify the manifest file with the following API... Service provider / middleware example... use Illuminate\Support\Facades\Vite;
Vite::useManifestFilename('custom-manifest.json');{{-- Uses the custom manifest filename --}}
@vite(['resources/js/app.js'])Inline example... {{ Vite::useManifestFilename('custom-manifest.json')->withEntryPoints(['resources/js/app.js']) }}Documentation PR: laravel/docs#8352 |
|
@timacdonald This is indeed a better way! Somewhat related to this PR: Shouldn't we do this with the 'buildDirectory' parameter also? If we can use the new API (useManifestFilename) via a global service provider or route-based middleware, it doesn't make sense to pass the custom build directory path as a parameter with every @Vite() call. Let me know what you think! |
|
@ngstwr that is already available with See: https://laravel.com/docs/9.x/vite#advanced-customization |
|
Oh, thanks, somehow I missed that section on the documentation! Will wait for this PR to be merged! |
Option added to pass the name of the manifest file to be used while using the Vite Facade.
Before:
Vite::asset(['resources/sass/app.scss'], 'dist')
Now:
Vite::asset(['resources/sass/app.scss'], 'dist', 'app-manifest.json')