@psoares/svg-list
v1.2.1
Published
Generates a JSON or Javascript list with optimised SVGs strings
Downloads
4,863
Maintainers
Readme
svg-list
Generates a JSON or Javascript list with optimised SVGs
Description
This small script is useful to maintain your project icons updated and optimised without having the painful work of everytime you change an svg icon file you need to go through SVG optimizer, clean the code and then just add it to you custom js or json files.
Install
yarn add @psoares/svg-list
Usage
- Create your setup file in the root of your project with the name
.svglistrc.json
{
"passAllAttributes": true, // optional: this will ensure all attrs from each pass will be passed to the generated file
"src": "icons", // source directory with multiple directories
"dest": "src/components/icons", // target directory for js / json fiiles
"format": "js", // optional: `js` (default) or `json`
}
- To generate your files run
yarn svglist generate
To do:
- To preview your generated files run
yarn svglist preview
This will fireup a simple react app that runs in port 8004 with a preview of all the svgs that you have generated.
Note: this will not generate the svg files for you, so you need to run generate first
License
MIT © psoaresbj