0.0.6 • Published 5 years ago

svg-icon-webpack-plugin v0.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

svg-icon-webpack-plugin

Auto convert svg to icon component data by webpack plugin。It's base on vue-svgicon component for svg solution。

Install

npm install svg-icon-webpack-plugin --save-dev

Usage

  1. Configure webpack plugin。In vue.config.js
const SvgIconWebpackPlugin = require('svg-icon-webpack-plugin')

module.exports = {
    configureWebpack: {
        plugins: [
            new SvgIconWebpackPlugin({
                // config setting
                sourcePath: './src/assets/svg',
                targetPath: './src/assets/icon',
            })
        ]
    }
}
  1. import result data in entry point file
npm install vue-svgicon
import * as svgicon from 'vue-svgicon'
import './assets/icon'
Vue.use(svgicon)
  1. use svgicon component in vue file
<svgicon name="arrow_down" width="50" height="50"></svgicon>
0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago