Skip to content

transform function does not run #377

@lloydjatkinson

Description

@lloydjatkinson

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

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions