Skip to main content
使用 bun create astro 初始化一个全新的 Astro 应用。create-astro 包会检测你是否使用了 bunx,并自动使用 bun 安装依赖。
terminal
bun create astro
╭─────╮  Houston:
│ ◠ ◡ ◠  很高兴你加入我们。
╰─────╯

 astro   v3.1.4 启动序列已启动。

   dir   应该在哪里创建你的新项目?
         ./fumbling-field

  tmpl   你想怎样开始你的新项目?
         使用博客模板
      ✔  模板已复制

  deps   安装依赖吗?

      ✔  依赖已安装

    ts   你打算写 TypeScript 吗?


   use   TypeScript 要多严格?
         严格
      ✔  TypeScript 已自定义

   git   初始化一个新的 git 仓库?

      ✔  Git 已初始化

  next   起飞确认。探索你的项目吧!

         使用 cd ./fumbling-field 进入你的项目目录
         运行 `bun run dev` 启动开发服务器。按 CTRL+C 停止。
         使用 astro add 添加 react 或 tailwind 等框架。

         遇到困难?加入我们 https://astro.build/chat

╭─────╮  Houston:
│ ◠ ◡ ◠  祝你好运,宇航员!🚀
╰─────╯

使用 bunx 启动开发服务器。 默认情况下,Bun 会用 Node.js 运行开发服务器。若想改用 Bun 运行时,请使用 --bun 标志。
terminal
bunx --bun astro dev
  🚀  astro  v3.1.4 在 200ms 内启动

  ┃ 本地    http://localhost:4321/
  ┃ 网络    使用 --host 公开访问

用浏览器打开 http://localhost:4321 查看效果。Astro 会在你编辑源文件时热重载你的应用。

请参考 Astro 文档 获得完整说明。