customize-cra icon indicating copy to clipboard operation
customize-cra copied to clipboard

Feature Request: Allow the enduser to make use of the SVGO portion of the SVGR loader

Open the-simian opened this issue 5 years ago • 1 comments

As of now, the CRA team has willfully disabled some of the capabilites of the SVGR loader, namely the 'prettier' and 'svgoOptions' portions when using the ability to import an svg as a ReactComponent and not as a src string.

Unfortunately, since they have disabled these options, a lot of the power of using an inline SVG is somewhat mitigated (such as using the currentColor instead of whatever hardcoded 'fill'/'stroke' is in the SVG for icons). To do this you need to programmatically manipulate an SVG when you import it. Understandably, the React team did not want to expose a feature that might confuse some endusers, if they were to import something and it appeared differently than the way it was exported from a design program.

That said there are enough compelling use cases to re-enable this feature, I think it should come in the standard loadout of customize-cra, and would be incredibly beneficial in a lot of situations, especially when the programmer of the application needs to 'prepare' the SVG assets for consumption and whatever program made the SVGs does not make them just right.

the-simian avatar Sep 18 '20 05:09 the-simian

this is resolved by https://github.com/arackaf/customize-cra/pull/271

the-simian avatar Sep 18 '20 05:09 the-simian