Last active
July 5, 2023 13:13
-
-
Save ChucKN0risK/b21ac81012a867167878b0756edbddab to your computer and use it in GitHub Desktop.
Generate icons as JSX components
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"repository": "@owner/repository", | |
"personalAccessToken": "<your-personal-access-token>", | |
"rules": [ | |
{ | |
"name": "Icons", | |
"path": "./output/assets/icons", | |
"filter": { | |
"types": [ | |
"vector" | |
] | |
}, | |
"parsers": [ | |
{ | |
"name": "kebabcasify" | |
}, | |
{ | |
"name": "svgo", | |
"options": { | |
"svgo": { | |
"plugins": [ | |
{ | |
"removeDimensions": true | |
}, | |
{ | |
"removeAttrs": { | |
"attrs": "*:(fill|stroke)" | |
} | |
} | |
] | |
} | |
} | |
}, | |
{ | |
"name": "svg-to-jsx", | |
"options": { | |
"prepend": "import React from 'react';", | |
"formatConfig": { | |
"variableFormat": "camelCase" | |
}, | |
"wrapper": { | |
"tag": "div", | |
"className": "icon-{{name}} icon" | |
} | |
} | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment