vite-plugin-vue
vite-plugin-vue copied to clipboard
Asset encoding in the data URI (Static Asset Handling) does not correctly indicate the type and cannot be disabled (assetsInlineLimit)
Related plugins
-
[X] plugin-vue
-
[ ] plugin-vue-jsx
Describe the bug
I'm trying to configure the svg favicon of an application, and that's where I realized that vitejs converts files less than the set assetsInlineLimit bytes to URI data in base64, I ran into 2 situations:
- With Static Asset Handling activated, the encoding of the .svg file to data URI is transformed from 'image/svg+xml' to 'image/png', replacing 'png' with 'svg+xml' manually everything worked fine.
Unable to find a solution or explanation to this, try disabling Static Asset Handling with assetsInlineLimit set to 0 as the documentation dictates (https://vitejs.dev/config/build-options#build-assetsinlinelimit)
- The build was still encoding the import, no matter what value you set assetsInlineLimit to.
Reproduction
https://stackblitz.com/edit/nuxt-starter-myrddp?file=app.vue
Steps to reproduce
No response
System Info
System:
OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
Memory: 7.71 GB / 15.35 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
Browsers:
Chrome: 125.0.6422.141
Used Package Manager
npm
Logs
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.
I can't reproduce it with your reproduction and this is not a vite-plugin-vue problem either. It should be a vite problem and maybe it has been fixed.
Closing as the reproduction does not exist.