svg-icon-webpack-plugin
v0.0.6
Published
svg-icon solution for webpack plugin
Downloads
10
Readme
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
- 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',
})
]
}
}
- import result data in entry point file
npm install vue-svgicon
import * as svgicon from 'vue-svgicon'
import './assets/icon'
Vue.use(svgicon)
- use svgicon component in vue file
<svgicon name="arrow_down" width="50" height="50"></svgicon>