Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hunghg255/react-generate-svg-2-icon
https://github.com/hunghg255/react-generate-svg-2-icon
generator icons reactjs svg
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hunghg255/react-generate-svg-2-icon
- Owner: hunghg255
- Created: 2023-04-19T11:44:28.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-03T08:41:13.000Z (9 months ago)
- Last Synced: 2024-05-03T13:28:27.615Z (9 months ago)
- Topics: generator, icons, reactjs, svg
- Language: TypeScript
- Homepage: https://react-generate-svg-2-icon.vercel.app
- Size: 129 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Generate Icon from Svg
## 1. Install
```bash
npm i @rgrove/parse-xml globby htmltojsx svgson --save-dev
```## 2. Create file scripts/generate-svg.mjs
```js
// Config path folder svg file and svg component
const PATH_FOLDER_SVGS = 'src/assets/svgs';
const PATH_FOLDER_ICONS = 'src/components/Icon';
```## 3. Add script package.json
```bash
"scripts": {
...
"g": "node scripts/generate-svg.mjs"
},
```## 4. Run
```bash
npm run g
```