GitXplorerGitXplorer
a

astro-bun

public
9 stars
1 forks
1 issues

Commits

List of commits on branch main.
Unverified
10071c2d68d58d9d0c8653e9acdd2df086e918d8

Update version

aandremralves committed a year ago
Unverified
ebc3c9883f9b2f6cc6085ddf9cb1b2655eac2d3f

Add description to readme

aandremralves committed a year ago
Unverified
c818d96558b34050de13ddf09a5230af15f3317d

Update version

aandremralves committed a year ago
Unverified
4b5e862cf2a12c2ca0681bd3508d6ad90bbea28b

Use esbuild for compilation

aandremralves committed a year ago
Unverified
8901de380df2814bac204aebfb5ccdb4394c56c1

Bump version

aandremralves committed a year ago
Unverified
d42e61cc55f776b7cba91268fea8f986abe4428a

Update old names and dependencies

aandremralves committed a year ago

README

The README file for this repository.

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