astro-bun-adapter
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

astro-bun-adapter

Allows Astro to run your SSR site with the Bun's native API Bun.serve.

Fix the astro-bun adapter's issue, serving static files.

Prerequisites

  • Bun

Installation

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

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

Package Sidebar

Install

npm i astro-bun-adapter

Weekly Downloads

32

Version

1.0.2

License

MIT

Unpacked Size

8.7 kB

Total Files

11

Last publish

Collaborators

  • ido.pluto