Closed dantman closed 11 months ago
We have a similar issues when bundling vite apps to electron/nwjs. there are some 3rd party integrations that expect urls/file paths and do not support inlined base64 assets.
I think #2173 (and #10578 and #8717) are related
I think it makes sense to not inline rel="icon"
by default, and the same for manifest files too
@bluwy It also makes sense to inline link rel="apple-touch-icon" by default since safari throws an error when the url is base64
eg:
Describe the bug
When Vite asset-ifies
<link>
resources it applies the default assetsInlineLimit for JS without considering whether it makes sense to inline the resource in HTML.One issue this causes is in site icons. If a site icon is small enough, instead of just putting it in /assets with a cache buster (which can be desirable for site icons), Vite will inline it into the document.
This is a problem since now site icons are downloaded inline with every page request which is problematic for a number of reasons:
Manifests are also inlined, but that bug was reported in #5962.
Reproduction
https://github.com/dantman/vite-excessive-inline-resources-bug
System Info
Used Package Manager
npm
Logs
Validations