Skip to content

bun create astro で新しい Astro アプリを初期化します。create-astro パッケージは bunx 使用時に自動検出し、bun で依存関係を自動的にインストールします。

sh
bun create astro
txt
╭─────╮  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 フラグを使用します。

sh
bunx --bun astro dev
txt
  🚀  astro  v3.1.4 started in 200ms

  ┃ Local    http://localhost:4321/
  ┃ Network  use --host to expose

ブラウザで http://localhost:4321 を開いて結果を確認します。ソースファイルを編集すると、Astro はアプリをホットリロードします。


完全なドキュメントについては、Astro ドキュメント を参照してください。

Bun by www.bunjs.com.cn 編集