airbnb / babel-plugin-inline-react-svg

A babel plugin that optimizes and inlines SVGs for your React Components.
MIT License
473 stars 92 forks source link

[Fix] Fix crash when svg has a style tag in the root element #116

Closed dozgunyal closed 1 year ago

dozgunyal commented 2 years ago

Hi, Fixes https://github.com/airbnb/babel-plugin-inline-react-svg/issues/105

Also sends the path name to SVGO.optimize as recommended and fixes the PrefixIds plugin to support dynamic file name prefixes.

Thank you in advance.

dozgunyal commented 2 years ago

What's the benefit of passing the path to optimize?

some plugins like prefixId depends on it. Such as adding the file name as prefix to all ids, which is super helpful to prevent style conflicts

ljharb commented 2 years ago

@lencioni this is good to go, but travis tests need fixing, and i can't do that efficiently without the ability to push to master (a branch protection requiring review prevents me). mind taking care of one or the other of those?

akellbl4 commented 2 years ago

@ljharb I took a look and it seems the latest NPM doesn't work with Node 10.x. Maybe it's worth dropping tests for Node 10.x?

ljharb commented 2 years ago

Nope, it’s not :-) but that’s not the issue; it’s that Travis doesn’t have an up to date version of nvm. Switching to GitHub actions would resolve that without needing a breaking change.