cascornelissen/svg-spritemap-webpack-plugin
소개
SVG spritemap plugin for webpack
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalSVG Spritemap Webpack Plugin
This webpack plugin generates a single SVG spritemap containing multiple <symbol> elements from all .svg
files in a directory. In addition, it can optimize the output and can also generate a stylesheet containing the sprites
to be used directly from CSS. Chris Coyier has a good write-up about the why's and how's of this technique on
CSS Tricks. Use it in combination with the svg4everybody package to easily and
correctly load SVGs from the spritemap in all browsers.
Installation
npm install svg-spritemap-webpack-plugin --save-dev
Usage
Webpack configuration
This plugin can be added to webpack like any other, documentation on all configuration options is available.
import SVGSpritemapPlugin from 'svg-spritemap-webpack-plugin';
export default {
// ...
plugins: [
new SVGSpritemapPlugin()
]
}
SVG element
When there's a file phone.svg in the source directory and the prefix option is set to sprite- (default),
the sprite can be included in a HTML-file like so:
<svg>
<use xlink:href="/path/to/spritemap.svg#sprite-phone"></use>
</svg>
SVG4Everybody
SVG for Everybody adds SVG External Content support to all browsers.
It's a good idea to combine the svg-spritemap-webpack-plugin with svg4everybody. This can be done
by passing an options object or true to the svg4everybody options key or by initializing SVG4Everybody manually.
License
관련 프로젝트 살펴보기
불러오는 중…