1.1.4 • Published 4 years ago
gensprite v1.1.4
Installation
npm install --save-dev gensprite
Using
All that is needed for the library to work is: 1) Folder with svg files 2) The html page in which the svg sprite will be inserted
Launch occurs through the command line:
gensprite
Work parameters can be specified:
1) Via command line arguments
2) In package.json of your project in "gensprite"
property
Parameter | cli | package.json | Default |
---|---|---|---|
The path to the image folder | --img or -i | "imgFolder" | ./src/assets/img |
The path to the "index" page | --output or -o | "indexFile" | ./src/index.html |
Sprite tag id | --spriteId or -s | "spriteId" | svg-sprite |
Core concepts
Tiny gen sprite uses <symbol>
way to make svg sprites.
Examples
Launch with command line arguments
gensprite -o="./index.html" --img="./images"
Parametrs in package.json
:
{
"name": "example-project",
"version": "1.0.0",
"gensprite": {
"imgFolder": "./src/images/svg",
"spriteId": "my-sprite"
}
}
License
MIT