-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Skip asset inlining for Git LFS placeholders #9714
Comments
This make sense to me. The change needed would be at vite/packages/vite/src/node/plugins/asset.ts Lines 425 to 434 in 31c2926
I think as a start, we could simply check if it starts with Also to confirm, if we do skip inlining it, would it properly served by default? |
Hello @MajorBreakfast. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it! |
@bluwy @patak-dev @sapphi-red Thanks for all the support in getting this shipped! |
Description
Vite by default automatically inlines assets that are below a specified size limit (
build.assetsInlineLimit
, docs).Unfortunately, if the build system does not download the LFS files for increased build performance (e.g. Netlify), this means that Git LFS placeholder files, which are small, also get inlined even though they do not contain the actual file content.
Example Git LFS placeholder file:
Suggested solution
Detect whether a file is an LFS placeholder (e.g. by comparing its first line) and skip inlining for detected LFS placeholders.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: