unIcons
A unified icon solution provided by WinJS, usingunplugin-icons as the underlying parsing tool. Compatible with multiple build tools such as webpack, rspack, vite, etc., and frontend frameworks such as Vue 2, Vue, etc. The plugin also has built-inResolver functionality that can automatically import required SVG icons.
Note
Please master the usage of unplugin-icons first.
Setup
- Install the plugin
bash
$ npm add @winner-fed/plugin-unicons -Dbash
$ yarn add @winner-fed/plugin-unicons -Dbash
$ pnpm add @winner-fed/plugin-unicons -Dbash
$ bun add @winner-fed/plugin-unicons -D- Enable the plugin in the
.winrcconfiguration file
ts
import { defineConfig }from 'win';export default defineConfig({ plugins: [require.resolve('@winner-fed/plugin-unicons')], unIcons: { include: [], // Supports unplugin-icons configuration parameters, such as customCollections: { ... } }});Configuration
include
- Type:
Array<string> - Default:
[]
Used for additional SVG files that need to be parsed using this solution. Note thatabsolute paths must be used, and they will be compressed by the plugin's built-in svgo.
Supports unplugin-icons Extended Configuration
- Inheritsconfiguration parameters from theunplugin-icons plugin
Note
- When using local icons, according to the naming rules ofunplugin-icons, it uses
iconas the prefix by default andwinas the collection. It parses SVG icons undersrc/iconsby default, such asicon-win-dog
