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

Adds webpack rules to generate optimized svg sprites.
1,418
Install
npm install @4tw/vue-cli-plugin-svg-icon
Latest Version:0.0.2
License:GPL-2.0
Last Updated:Dec 3, 2022
Links: GitHub  ·  npm
Maintainer: gaebu

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

Related Packages

vue-cli-plugin-svg-loader

Vue CLI plugin that adds vue-svg-loader to enable usage of SVG files as Vue comp...

1,265 0
vue-svg-loader

Use SVG files as Vue Components

3,476,564 645
vue3-loading-overlay

Vue.js component for full screen loading indicator, compatible for vue3.

156,113 13
vue-svg-icon-loader

Turn SVG files into Vuejs Icon Components

77,615 23

Version History

Version Released License
0.0.2 GPL-2.0
0.0.1 GPL-2.0