babel-plugin-react-primitives-svg
v2.0.2
Published
A babel plugin that transforms SVG imports into react-primitives-svg compatible components.
Downloads
17
Maintainers
Readme
babel-plugin-react-primitives-svg
A babel plugin that transforms SVG imports into react-primitives-svg-compatible primitives.
🚨 This is super BETA 🚨
This is my first dip into the babel plugin pool, so any help testing or developing would be greatly appreciated.
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": [
"babel-plugin-react-primitives-svg"
]
}
Options
verbose
- Log level (boolean
, default:false
)defaultWidth
- Default pixel width for SVG (string
ornumber
, default:100%
)defaultHeight
- Default pixel height for SVG (string
ornumber
, default:100%
)- ...inherited options from babel-plugin-react-sketchapp-svg
Example:
{
"plugins": [
[
"babel-plugin-react-primitives-svg",
{
"defaultWidth": 32,
"defaultHeight": 32,
"svgo": {
"plugins": [
{
"removeAttrs": { "attrs": "(data-name)" }
},
{
"cleanupIDs": true
}
]
}
}
]
]
}