Skip to content

Conversation

daun
Copy link
Contributor

@daun daun commented Oct 7, 2025

A much trimmed-down version of the proposed change in #57289 which was (rightly) rejected as feature creep.

This adds nothing but only makes the Vite class more extendable via inheritance. It moves the public path generation of Vite assets into a protected method. Any custom setups can extend the Vite class and overwrite this method.

Example usage (remove query string hash before generating disk path):

->withSingletons([
    Vite::class => fn() => new class extends Vite {
        protected function publicPath($path) {
            return parent::publicPath(Str::before($path, '?'));
        }
    }
])

@taylorotwell taylorotwell merged commit 1c669e6 into laravel:12.x Oct 7, 2025
66 checks passed
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