@medienwerft/svg-data-generator
v0.1.3
Published
generates svg sprites, modal and svg storybook from given svg files
Downloads
5
Readme
svg data generator
generates useful svg related code like sprites, enum and a storybook's story (angular specific) from a given svg folder.
Installing
npm install @medienwerft/svg-data-generator --save-dev
Usage
Create config
In the root of your project add a .svgdatageneratorrc.json
file and add the following content and replace the values:
{
"svgDir": "path/to/svg/folder/",
"svgSpritesPath": "path/to/sprites/<file_name>.svg",
"svgModel": {
"path": "path/to/models/<file_name>",
"enumName": "<enumName>"
},
"svgStorybook": {
"storyName": "<storyName>",
"componentPath": "path/to/angular/component/<component_name>",
"path": "path/to/story/<file_name>"
}
}
Use
run the following command to your package.json scripts:
{
"generate-svg-data": "generate-svg-data"
}
now you can run:
npm run generate-svg-data