> ## Documentation Index
> Fetch the complete documentation index at: https://bun.ll1025.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 Qwik 和 Bun 构建应用

使用 `bunx create-qwik` 初始化一个新的 Qwik 应用。

`create-qwik` 包会检测到你正在使用 `bunx`，并使用 `bun` 安装依赖。

```sh terminal icon="terminal" theme={null}
bun create qwik
```

```txt theme={null}
      ............
    .::: :--------:.
   .::::  .:-------:.
  .:::::.   .:-------.
  ::::::.     .:------.
 ::::::.        :-----:
 ::::::.       .:-----.
  :::::::.     .-----.
   ::::::::..   ---:.
    .:::::::::. :-:.
     ..::::::::::::
             ...::::


┌  让我们创建一个 Qwik 应用  ✨ (v1.2.10)
│
◇  你想在哪里创建你的新项目？（使用 '.' 或 './' 表示当前目录）
│  ./my-app
│
●  正在 /path/to/my-app 中创建新项目... 🐇
│
◇  选择一个启动模板
│  基础应用
│
◇  是否安装 bun 依赖？
│  是
│
◇  是否初始化一个新的 git 仓库？
│  否
│
◇  完成安装。想听个笑话吗？
│  是
│
○  ────────────────────────────────────────────────────────╮
│                                                          │
│  你怎么知道床底下有头大象？                                │
│  你的头撞到天花板了！                                      │
│                                                          │
├──────────────────────────────────────────────────────────╯
│
◇  应用已创建 🐰
│
◇  已安装 bun 依赖 📋
│
○  结果 ─────────────────────────────────────────────╮
│                                                      │
│  成功！项目已创建在 my-app 目录中                      │
│                                                      │
│  集成？添加 Netlify、Cloudflare、Tailwind...          │
│  bun qwik add                                        │
│                                                      │
│  相关文档：                                          │
│  https://qwik.dev/docs/getting-started/              │
│                                                      │
│  有问题？加入对话：                                   │
│  https://qwik.dev/chat                               │
│  https://twitter.com/QwikDev                         │
│                                                      │
│  演示、播客和视频：                                   │
│  https://qwik.dev/media/                             │
│                                                      │
│  后续步骤：                                          │
│  cd my-app                                           │
│  bun start                                           │
│                                                      │
│                                                      │
├──────────────────────────────────────────────────────╯
│
└  编码愉快！🎉

```

***

运行 `bun run dev` 启动开发服务器。

```sh terminal icon="terminal" theme={null}
bun run dev
```

```txt theme={null}
$ vite--mode ssr

VITE v4.4.7 在 1190 毫秒内准备就绪

➜  本地：   http://localhost:5173/
➜  网络：   使用 --host 暴露
➜  按 h 显示帮助
```

***

在浏览器中打开 [http://localhost:5173](http://localhost:5173) 查看结果。Qwik 会在你编辑源文件时热重载你的应用。

<Frame>![Qwik 截图](https://github.com/oven-sh/bun/assets/3084745/ec35f2f7-03dd-4c90-851e-fb4ad150bb28)</Frame>

***

参见 [Qwik 文档](https://qwik.dev/docs/getting-started/) 了解更多。
