lhl 6ff0e96ad3 8-4-1 | há 1 ano atrás | |
---|---|---|
.. | ||
build | há 1 ano atrás | |
README.md | há 1 ano atrás | |
main.css | há 1 ano atrás | |
main.html | há 1 ano atrás | |
main.js | há 1 ano atrás | |
webpack.config.js | há 1 ano atrás |
Extract SVG sprite as separate file with extract: true
option (see webpack config).
When loader is in extract mode, the returning value is extracted sprite file URL with symbol id at the end, e.g. sprite.svg#symbolId
.
This makes possible to use SVG stacking technique which
supported by most of browsers except of Safari (both desktop and mobile) and Android browser prior to 4.4.4.
import './logo.svg';
module.exports = 'sprite.svg#logo-usage';
.logo {background: url('./logo.svg')}
.logo {background: url('sprite.svg#logo-usage')}
<img src="./logo.svg" alt="">
<img src="sprite.svg#logo-usage" alt="">