Skip to content

Icons Legacy Solution

Bundler support: relies on svg-sprite-loader; only usable in webpack mode. vite is unsupported; in rsbuild / rsbuild2 modes, svg asset processing fails due to an incompatibility between svg-sprite-loader and rspack's ModuleGraph timing (rsbuild 1.x / 2.x behave identically; a pre-existing limitation). NPM Version

Legacy solution for icons, primarily provided for Vue 2 usage. Uses the SvgIcon component. SVG files in the src/icons directory use this solution by default. This solution relies on svg-sprite-loader implementation, so the bundler does not support Vite.

Setup

  1. Install the plugin
bash
$ npm add @winner-fed/plugin-icons-legacy -D
bash
$ yarn add @winner-fed/plugin-icons-legacy -D
bash
$ pnpm add @winner-fed/plugin-icons-legacy -D
bash
$ bun add @winner-fed/plugin-icons-legacy -D
  1. Enable the plugin in the .winrc configuration file
ts
import { defineConfig } from 'win';

export default defineConfig({
  plugins: [require.resolve('@winner-fed/plugin-icons-legacy')],
  iconsLegacy: {
    include: []
  }
});

Configuration

include

  • Type: Array<string>
  • Default: []

Used for additional SVG files that need to be parsed using this solution. Note that absolute paths must be used.

Released under the MIT License.