README
gensprite
Incredibly simple and small library for svg sprites.
Installation
npm install --save-dev gensprite
Using
All that is needed for the library to work is:
- Folder with svg files
- The html page in which the svg sprite will be inserted
Launch occurs through the command line:
gensprite
Work parameters can be specified:
- Via command line arguments
- 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"
package.json
:
Parametrs in {
"name": "example-project",
"version": "1.0.0",
"gensprite": {
"imgFolder": "./src/images/svg",
"spriteId": "my-sprite"
}
}
License
MIT