unplugin / unplugin-icons

🤹 Access thousands of icons as components on-demand universally.
https://www.npmjs.com/package/unplugin-icons
MIT License
4.13k stars 144 forks source link

transform function does not run #377

Open lloydjatkinson opened 2 months ago

lloydjatkinson commented 2 months ago

Describe the bug

Hi,

My transform function does not seem to run. I even added a console log in here, expecting some output in the terminal and I get none, so I believe the function is simply not being called.

            Icons({
                compiler: 'jsx',
                jsx: 'react',
                scale: 1,
                transform(svg) {
                    return svg.replace(/stroke-width="\d+(\.\d+)?"/, 'stroke-width="2"');
                },
            }),

I'm trying to update the stroke width, but the attribute does not get updated.

image

Reproduction

The react example

System Info

Windows, Node 21

Used Package Manager

pnpm

Validations