bun-hot-reloading

仓库创建 2025年11月8日最近提交 29 天前SkillHot 收录 22 天前
▸ 精选理由

显著缩短开发反馈循环,提升本地调试效率。

这个 Skill 做什么

使用 Bun 的 --watch / --hot 实现开发时自动重载与模块热替换。

在 Bun 开发时实现自动重载与模块热替换,支持 --watch(重启进程)和 --hot(保留状态的 HMR)。开发 HTTP 服务(Bun.serve)或快速迭代时用,能把代码变更即时反映到运行环境或浏览器。特点是区分重启与热加载的权衡,速度快且配置简单。

▸ 展开 SKILL.md 英文原文

Use when implementing hot reloading with Bun (--hot, --watch), HMR, or automatic code reloading during development. Covers watch mode, hot mode, and HTTP server reload.

开发编程热重载开发效率HMR通用
180
Stars
28
Forks
40
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/secondsky/claude-skills/main/plugins/bun/skills/bun-hot-reloading/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/secondsky/claude-skills/main/plugins/bun/skills/bun-hot-reloading/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Bun Hot Reloading

Bun provides built-in hot reloading for faster development cycles.

## Watch Mode vs Hot Mode

| Feature | `--watch` | `--hot` |
|---------|-----------|---------|
| Behavior | Restart process | Reload modules |
| State | Lost on reload | Preserved |
| Speed | ~20ms restart | Instant reload |
| Use case | Any file type | Bun.serve HTTP |

## Watch Mode (--watch)

Restarts the entire process when files change.

```bash
# Basic watch mode
bun --watch run src/index.ts

# Watch specific script
bun --watch run dev

# Watch with test runner
bun --watch test
```

### package.json Scripts

```json
{
  "scripts": {
    "dev": "bun --watch run src/index.ts",
    "dev:server": "bun 
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有