rsbuild-plugin-image-compress icon indicating copy to clipboard operation
rsbuild-plugin-image-compress copied to clipboard

svg compress error when the svg size is big and use the default config

Open TaueFenCheng opened this issue 6 months ago • 4 comments

i use the default plugin config like plugins: [pluginImageCompress(['jpeg', 'png', 'ico', 'svg', 'avif'])] when the svg size is big compress will be case error such as follow:

Image

TaueFenCheng avatar May 29 '25 09:05 TaueFenCheng

Can you provide a minimal reproduction? thank you!

chenjiahan avatar May 29 '25 09:05 chenjiahan

https://github.com/TaueFenCheng/demo-compress.git run pnpm build can show the error infos

TaueFenCheng avatar May 29 '25 10:05 TaueFenCheng

when the svg size

Adjusting floatPrecision remediates the issue @TaueFenCheng . The lower the better chance a large svg will compress. 2 works for your case.

Further reading here.

hirako2000 avatar Aug 27 '25 16:08 hirako2000

Thanks i have already solve this problem ~

TaueFenCheng avatar Sep 29 '25 06:09 TaueFenCheng