Skip to content

Add asset versioning for default build location using vite #399

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

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

WouterSioen
Copy link
Contributor

@WouterSioen WouterSioen commented May 24, 2022

When mix is not used for asset compilation, chances are high that vite is used instead.
That's why I think it makes sense to add the default location that vite builds to as a
fallback for when now mix-manifest is available.

https://laravel-vite.dev/guide/essentials/building-for-production.html#build-path contains
some information about the default production build using laravel-vite.

When mix is not used for asset compilation, chances are high that vite is used instead.
That's why I think it makes sense to add the default location that vite builds to as a
fallback for when now mix-manifest is available
@reinink
Copy link
Member

reinink commented May 25, 2022

Hey thanks for this. Is the build/manifest.json path specific to the Laravel Vite package, or is this just a Vite default when running a build?

@WouterSioen
Copy link
Contributor Author

This is mostly specific to the Laravel Vite package. The default build folder for vite is the dist folder. This makes sense in an SPA where you just deploy the frontend code but not really in a Laravel + Inertia app where you deploy your frontend code inside your public folder to make it accessible from the browser.

@jessarcher
Copy link
Member

@reinink This would also work for the official Laravel Vite integration as it uses the same path.

@reinink reinink merged commit 540b953 into inertiajs:master Jun 27, 2022
@reinink
Copy link
Member

reinink commented Jun 27, 2022

Great, thanks @WouterSioen and @jessarcher — that makes sense to me 👍

@bcalik
Copy link

bcalik commented Jun 28, 2022

btw why not use something faster than md5, like a non-cryptographic hashing algorithm like crc, which is also used for detecting unintentional errors in data.

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.

4 participants