ephor / svg-sprite-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

svg-sprite-plugin

Webpack plugin based on Svg-sprite

Installation

npm i svg-sprite-plugin --save-dev

Usage

//webpack.config.js
const SVGSprites = require('svg-sprite-plugin');
module.exports = {
  plugins: [
    new SVGSprites({
      src: 'public/image/svg_icons/',
      log: 'verbose',
      sprites_conf: {
        'sprite-1': {
           mode: {
             defs: {
               dest: path.resolve('svg_sprites/sprite-dest-1/defs'),
               sprite: 'sprite.svg',
               example: true,
           },
        },
        'sprite-2': {
           mode: {
             defs: {
               dest: path.resolve('svg_sprites/sprite-dest-2/defs'),
               sprite: 'sprite.svg',
               example: true,
           },
        },
      }
    })
  ]
}

Other configuration options

About


Languages

Language:JavaScript 100.0%