zhaojinyu e984acc6d0 first commit 10 月之前
..
dist e984acc6d0 first commit 10 月之前
node_modules e984acc6d0 first commit 10 月之前
CHANGELOG.md e984acc6d0 first commit 10 月之前
LICENSE e984acc6d0 first commit 10 月之前
README.md e984acc6d0 first commit 10 月之前
generated.d.ts e984acc6d0 first commit 10 月之前
package.json e984acc6d0 first commit 10 月之前

README.md

vite-plugin-purge-icons

Vite Plugin for PurgeIcons

Usage

ℹ️ Vite 2 is supported from v0.5.x, Vite 1's support is discontinued.

Install

npm i @iconify/iconify
npm i vite-plugin-purge-icons @iconify/json -D

@iconify/json is an optional dependencies of PurgeIcons. When it presents in your node_modules, PurgeIcons will load the icons from it locally, otherwise, PurgeIcons will try to fetch the iconset your requested online.

Add it to vite.config.js

// vite.config.js
import PurgeIcons from 'vite-plugin-purge-icons'

export default {
  plugins: [
    PurgeIcons({
      /* PurgeIcons Options */
    })
  ]
}

Import @purge-icons/generated in your main.js

import { createApp } from 'vue'
import App from './App.vue'

import '@purge-icons/generated' // <-- This

createApp(App).mount('#app')

Configuration

Check out in PurgeIcons

Example

See the Vitesse starter template.

License

MIT License © 2020 Anthony Fu