使用 bun create astro
初始化一个新的 Astro 应用。当您使用 bunx
时,create-astro
包会检测到并自动使用 bun
安装依赖项。
bun create astro
╭─────╮ Houston:
│ ◠ ◡ ◠ We're glad to have you on board.
╰─────╯
astro v3.1.4 Launch sequence initiated.
dir Where should we create your new project?
./fumbling-field
tmpl How would you like to start your new project?
Use blog template
✔ Template copied
deps Install dependencies?
Yes
✔ Dependencies installed
ts Do you plan to write TypeScript?
Yes
use How strict should TypeScript be?
Strict
✔ TypeScript customized
git Initialize a new git repository?
Yes
✔ Git initialized
next Liftoff confirmed. Explore your project!
Enter your project directory using cd ./fumbling-field
Run `bun run dev` to start the dev server. CTRL+C to stop.
Add frameworks like react or tailwind using astro add.
Stuck? Join us at https://astro.build/chat
╭─────╮ Houston:
│ ◠ ◡ ◠ Good luck out there, astronaut! 🚀
╰─────╯
使用 bunx
启动开发服务器。
默认情况下,Bun 将使用 Node.js 运行开发服务器。要改为使用 Bun 运行时,请使用 --bun
标志。
bunx --bun astro dev
🚀 astro v3.1.4 started in 200ms
┃ Local https://127.0.0.1:4321/
┃ Network use --host to expose
在浏览器中打开 https://127.0.0.1:4321 以查看结果。当您编辑源文件时,Astro 将热重载您的应用。
有关完整文档,请参阅 Astro 文档。