Movatterモバイル変換


[0]ホーム

URL:


Skip to content

unIcons

NPM Version

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

  1. Install the plugin
bash
$ npm add @winner-fed/plugin-unicons -D
bash
$ yarn add @winner-fed/plugin-unicons -D
bash
$ pnpm add @winner-fed/plugin-unicons -D
bash
$ bun add @winner-fed/plugin-unicons -D
  1. Enable the plugin in the.winrc configuration 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

Note

  • When using local icons, according to the naming rules ofunplugin-icons, it usesicon as the prefix by default andwin as the collection. It parses SVG icons undersrc/icons by default, such asicon-win-dog

[8]ページ先頭

©2009-2025 Movatter.jp