@4tw/vue-cli-plugin-svg-icon

0.0.2 • Public • Published

vue-cli-plugin-svg-icon

Adds webpack rules to generate optimized svg sprites.

Setup

yarn add --dev @4tw/vue-cli-plugin-svg-icon

Usage

Provide a svgDir option under pluginOptions in your vue.config.js config.

module.exports = {
  pluginOptions: {
    svgDir: path.resolve(__dirname, 'src/assets/svg'),
  },
}

Usage

All svg files under the svgDir are processes and provided as an import. The imports are aliased under svg.

import Icon from 'svg/your_icon.svg'

The imported module provides a symbol from the svg-sprite-loader

Readme

Keywords

Package Sidebar

Install

npm i @4tw/vue-cli-plugin-svg-icon

Weekly Downloads

55

Version

0.0.2

License

GPL-2.0

Unpacked Size

73.9 kB

Total Files

6

Last publish

Collaborators

  • gaebu
  • joel87
  • loeru
  • kevin.bieri
  • tschouns
  • all4manu
  • buchijs
  • elioschmutz