webpack-svg-sprite-plugin
v1.2.0
Published
Generates an SVG sprite from imported SVG files
Downloads
8
Readme
webpack-svg-sprite-plugin
Webpack plugin that finds all SVG assets in the build and generates a svg sprite with <symbol>
elements.
Installation
$ npm i --save webpack-svg-sprite-plugin
Usage
var SvgSpritePlugin = require('webpack-svg-sprite-plugin')
module.exports = {
// ...
plugins: [
new SvgSpritePlugin({ filename: 'my-sprite.svg' })
]
}
Configuration
{
filename: 'sprite-name.svg' // Filename the sprite will be added with. Default: 'svg-sprite.svg'
}
Scripts
npm run compile
- Compiles the module to disk (~/lib).npm run compile:watch
- Same asnpm run compile
but watches files for changes.npm run lint
- Lints all files.npm run lint:fix
- Lints all files and attempts to fix any issues.npm run test
- Runs unit tests.npm run test:watch
- Same asnpm test
but watches files for changes.npm run test:cov
- Generates a test coverage report.
Commitizen
eslint-config-rentpath
uses Commitizen to format commit messages.
- Install it globally
$ npm install -g commitizen
Once you are ready to commit, follow the familiar github workflow, with a slight change.
$ git add <files>
$ git cz
$ git cz
will bring up the Commitizen commit prompt, follow the instructions, and $ git push
as usual.