mirror of
https://github.com/RealKai42/qwerty-learner.git
synced 2026-04-05 14:29:04 +08:00
refactor: use unplugin-icons to unify all icons (#439)
Co-authored-by: KaiyiWing <Zhang.kaiyi42@gmail.com>
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { promises as fs } from 'fs'
|
||||
import { getLastCommit } from 'git-last-commit'
|
||||
import jotaiDebugLabel from 'jotai/babel/plugin-debug-label'
|
||||
import jotaiReactRefresh from 'jotai/babel/plugin-react-refresh'
|
||||
import path from 'node:path'
|
||||
import { visualizer } from 'rollup-plugin-visualizer'
|
||||
import Icons from 'unplugin-icons/vite'
|
||||
import { defineConfig, type PluginOption } from 'vite'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
@@ -12,7 +14,19 @@ export default defineConfig(async () => {
|
||||
return getLastCommit((err, commit) => (err ? 'unknown' : resolve(commit.shortHash)))
|
||||
})
|
||||
return {
|
||||
plugins: [react({ babel: { plugins: [jotaiDebugLabel, jotaiReactRefresh] } }), visualizer() as PluginOption],
|
||||
plugins: [
|
||||
react({ babel: { plugins: [jotaiDebugLabel, jotaiReactRefresh] } }),
|
||||
visualizer() as PluginOption,
|
||||
Icons({
|
||||
compiler: 'jsx',
|
||||
jsx: 'react',
|
||||
customCollections: {
|
||||
'my-icons': {
|
||||
xiaohongshu: () => fs.readFile('./src/assets/xiaohongshu.svg', 'utf-8'),
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
build: {
|
||||
minify: true,
|
||||
outDir: 'build',
|
||||
|
||||
Reference in New Issue
Block a user