Skip to content

Commit 61d7ef6

Browse files
fix: 修复启动慢问题
1 parent 78aeb89 commit 61d7ef6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

uno.config.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const createPresetIcons = () => {
88
const isBuild = !!process.argv[4]
99
let env = {} as any
1010
if (!isBuild) {
11-
env = loadEnv(process.argv[4], root)
12-
} else {
1311
env = loadEnv(process.argv[3], root)
12+
} else {
13+
env = loadEnv(process.argv[4], root)
1414
}
1515
// @ts-ignore
1616
if (env.VITE_USE_ONLINE_ICON === 'true') {
@@ -19,6 +19,12 @@ const createPresetIcons = () => {
1919
return [
2020
presetIcons({
2121
prefix: ''
22+
// 由于默认加载的是所有的图标,启动会非常慢,可以在这里去加载需要的图标,确保启动速度
23+
// collections: {
24+
// carbon: () => import('@iconify-json/carbon/icons.json').then(i => i.default),
25+
// mdi: () => import('@iconify-json/mdi/icons.json').then(i => i.default),
26+
// logos: () => import('@iconify-json/logos/icons.json').then(i => i.default),
27+
// }
2228
})
2329
]
2430
}

0 commit comments

Comments
 (0)