babel-plugin-inline-react-svg
babel-plugin-inline-react-svg copied to clipboard
A babel plugin that optimizes and inlines SVGs for your React Components.
It'd be nice if a file could have `export { default } from 'path/to.svg';` and have that be transformed just as if it was `import x from 'path/to.svg'; export default...
This checks if the build passes when svgo is turned off. Notably, it currently doesn't! 🎉 That is due to the xml tag in our example svgs. I don't know...
This plugin removes the `xmlns` attribute from the top-level svg element, which is safe for inline SVGs, which is how all SVGs transformed by this plugin will end up being...
Fixes #13 Can be used like this: ``` // .babelrc { "plugins": [ ["inline-react-svg", { "statefulComponent": true }] ] } ``` ``` // React import React from 'react'; import CloseSVG...
I have tested the code with a simple SVG and it works. Apparently there is an issue my selected more complex SVG that includes imbedded Javascript in a CDATA. It...
Implements CI jobs with Github Actions [Passed actions on my fork](https://github.com/akellbl4/babel-plugin-inline-react-svg/actions/runs/3049752616/jobs/4916136286)
Hi, Fixes https://github.com/airbnb/babel-plugin-inline-react-svg/issues/105 Also sends the path name to [SVGO.optimize](https://github.com/svg/svgo#optimize ) as recommended and fixes the PrefixIds plugin to support dynamic file name prefixes. Thank you in advance.
Currently when this package is installed you get a warning sth like this: ``` warning babel-plugin-inline-react-svg > svgo > [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so...
An extra `!` has been added in the comments in the SVGs in Font Awesome 6, so they change from `
adds includePattern as options , which is usefull when there are few paths that needs to be included instead of ignoring a lot of patterns.