Skip to content

Add build.assetInlineExclude config #2173

@gnuletik

Description

@gnuletik

Is your feature request related to a problem? Please describe.

When building for production, the following line :

<!-- index.html -->
<link rel="icon" type="image/png" href="favicon.png">

get transformed in this

<!-- index.html -->
<link rel="icon" type="image/png" href="data:image/png;base64,...(not included)...">

Inlining the favicon png does not allow browser caching. I'd rather like it to not be inlined but keep inline feature for other files.

Describe the solution you'd like

Have a way to exclude some files from being inlined.

A clear and concise description of what you want to happen.

// vite.config.js
export default {
  build: {
    assetInlineExclude: ['favicon.png']
  }
}

Would all assets except inline favicon.png.

Describe alternatives you've considered

Setting build.assetInlineLimit: 0 disables asset inlining but I want to keep it for other files than favicon.png.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions