0.0.5-beta • Published 8 months ago

astro-bun v0.0.5-beta

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

astro-bun

This adapter allows Astro to run your SSR site with the Bun's native API Bun.serve.

Prerequisites

  • Bun

Installation

  1. Install astro-bun package
bun add astro-bun
  1. Update your astro.config.mjs to use astro-bun adapter.
// astro.config.mjs
import { defineConfig } from 'astro/config';
import bun from 'astro-bun';

export default defineConfig({
  output: 'server',
  adapter: bun(),
});
  1. Build your project.
bunx --bun astro build

This will generate an entry.mjs script inside ./dist/server.

  1. Run the entry.mjs script.
bun run ./dist/server/entry.mjs

or, you can update the preview script in you package.json.

// package.json
{
  // ...
  "scripts": {
    "dev": "astro dev",
    "start": "astro dev",
    "build": "astro build",
    "preview": "bun run ./dist/server/entry.mjs"
  }
}

and then just run:

bunx --bun astro preview
0.0.5-beta

8 months ago

0.0.4-beta

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago