AgentSkillsCN

regenerate-preload-icons

在trizum PWA中重新生成预加载图标文件(preloadIcons.gen.ts)。在源代码中新增或移除lucide图标引用(#lucide/...)后,请务必使用此方法。触发条件包括:“重新生成图标”、“预加载图标”、“更新图标预加载”,或在使用新lucide图标并需提前加载时。

SKILL.md
--- frontmatter
name: regenerate-preload-icons
description: >
  Regenerate the preloaded icons file (preloadIcons.gen.ts) in the trizum PWA.
  Use after adding or removing lucide icon references (#lucide/...) in source code.
  Triggers: "regenerate icons", "preload icons", "update icon preloads",
  or when a new lucide icon is used and needs to be preloaded.

Regenerate Preload Icons

packages/pwa/src/preloadIcons.gen.ts is auto-generated by vite-plugin-preload-icons during dev server startup. Regenerate it whenever icon usage changes.

Steps

  1. Start the dev server, load the page to trigger icon scanning, then stop:
    bash
    cd packages/pwa && pnpm dev &
    sleep 5
    curl -s http://localhost:5173/ > /dev/null 2>&1 || curl -s http://localhost:5174/ > /dev/null 2>&1 || curl -s http://localhost:5175/ > /dev/null 2>&1
    sleep 5
    kill %1 2>/dev/null
    wait 2>/dev/null
    
  2. Verify the change in packages/pwa/src/preloadIcons.gen.ts.
  3. Commit the updated file.