babel-plugin-react-primitives-svg

2.0.2 • Public • Published

babel-plugin-react-primitives-svg

FOSSA Status

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 or number, default: 100%)
  • defaultHeight - Default pixel height for SVG (string or number, 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
            }
          ]
        }
      }
    ]
  ]
}
 

License

FOSSA Status

/babel-plugin-react-primitives-svg/

    Package Sidebar

    Install

    npm i babel-plugin-react-primitives-svg

    Weekly Downloads

    18

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    120 kB

    Total Files

    20

    Last publish

    Collaborators

    • hermanya