Skip to content

Commit

Permalink
fix: 修复启动慢问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong321200875 committed Feb 22, 2024
1 parent 78aeb89 commit 61d7ef6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const createPresetIcons = () => {
const isBuild = !!process.argv[4]
let env = {} as any
if (!isBuild) {
env = loadEnv(process.argv[4], root)
} else {
env = loadEnv(process.argv[3], root)
} else {
env = loadEnv(process.argv[4], root)
}
// @ts-ignore
if (env.VITE_USE_ONLINE_ICON === 'true') {
Expand All @@ -19,6 +19,12 @@ const createPresetIcons = () => {
return [
presetIcons({
prefix: ''
// 由于默认加载的是所有的图标,启动会非常慢,可以在这里去加载需要的图标,确保启动速度
// collections: {
// carbon: () => import('@iconify-json/carbon/icons.json').then(i => i.default),
// mdi: () => import('@iconify-json/mdi/icons.json').then(i => i.default),
// logos: () => import('@iconify-json/logos/icons.json').then(i => i.default),
// }
})
]
}
Expand Down

0 comments on commit 61d7ef6

Please sign in to comment.