I’d like to report a minor bug. When I import images using only the ?raw or ?url queries, the plugin processes them when it shouldn’t. As a result, the asset build generates images in .png format instead of preserving the original file format. It seems that if the format is not specified, the plugin defaults to converting images to .png.
According to the Vite documentation on Static Asset Handling I can import an image using these arguments to determine whether to receive the asset's URL or a string containing the image content, which is particularly useful for .svg files.
This issue can be easily circumvented with the following configuration:
However, I think it is appropriate to apply a FIX directly in the plugin code, since the ?url and ?raw queries are vite-specific features and should be handled automatically by the plugin.
I’d like to report a minor bug. When I import images using only the
?raw
or?url
queries, the plugin processes them when it shouldn’t. As a result, the asset build generates images in.png
format instead of preserving the original file format. It seems that if the format is not specified, the plugin defaults to converting images to.png
.According to the Vite documentation on Static Asset Handling I can import an image using these arguments to determine whether to receive the asset's URL or a string containing the image content, which is particularly useful for
.svg
files.This issue can be easily circumvented with the following configuration:
However, I think it is appropriate to apply a FIX directly in the plugin code, since the
?url
and?raw
queries are vite-specific features and should be handled automatically by the plugin.Thank you.