kickjs-bootstrap-export
Use when HMR is silently doing full restarts on every save, or createTestApp can't find the app handle.
来源信息
- 仓库
- forinda/sdeploy
- 最近来源活动
- 2026年9月22日 19:55
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 0
- 分支
- 0
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- kickjs-bootstrap-export
- description
- Use when HMR is silently doing full restarts on every save, or createTestApp can't find the app handle.
<!-- Generated by `kick g agents` for sdeploy. Edits are overwritten on the next refresh; keep customisation in a SKILL.local.md alongside. -->
**Check** `src/index.ts`'s last line:
```ts
// CORRECT — Vite plugin + createTestApp import the named `app` symbol
export const app = await bootstrap({ ... })
// WRONG — HMR degrades to full restart, createTestApp loses the handle
await bootstrap({ ... })
```
The Vite plugin imports the named `app` symbol via `virtual:kickjs/app`; testing helpers do too. Without the export, both fall back to slower paths (full restart on save, mock handle in tests) **without warning**.
**Red flags**:
- A bare `await bootstrap(...)` with no `export` — fix by adding `export const app =`.
- Re-assigning `app` later in the file (`app = somethingElse`) — Vite imports by reference at module-load time; reassignments don't propagate.
- Multiple files calling `bootstrap()` — only the entry should. Tests use `createTestApp` instead.
在 GitHub 查看