babel-plugin-inline-react-svg
Transforms imports to SVG files into React Components, and optimizes the SVGs with SVGO.
For example, the following code...
will be transformed into...
Installation
npm install --save-dev babel-plugin-inline-react-svg
Usage
Via .babelrc
(Recommended)
.babelrc
Options
ignorePattern
- A pattern that imports will be tested against to selectively ignore imports.caseSensitive
- A boolean value that if true will require file paths to match with case-sensitivity. Useful to ensure consistent behavior if working on both a case-sensitive operating system like Linux and a case-insensitive one like OS X or Windows.svgo
- svgo options (false
to disable). Example: