Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```