Skip to main content
使用 bun create astro 初始化一个全新的 Astro 应用。当您使用 bunx 时,create-astro 包会检测到并自动使用 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 文档 获取完整文档。