Skip to content

Skip asset inlining for Git LFS placeholders #9714

Closed
@MajorBreakfast

Description

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:

version https://git-lfs.github.com/spec/v1
oid sha256:5c908e755763256d23fdf72665459361bfa6e9e0de8fe9de1c122f3db6708317
size 176336

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions