@nurodev/astro-bun
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

astro-bun

This adapter allows Astro to deploy your SSR site to Bun targets.

Features

All functionality offered in astro-bun-adapter is also available in this project, along with some additional features:

  • Hybrid Output Support: You can now use "output": "hybrid" in your astro.config.mjs to output both static and server-rendered pages.
  • Improved server URL logging: The URL printed to the console when the server is started now shows the full URL rather than just the port.
  • Process exit & shutdown handlers: Added support for process.on handlers for when the server exists, or intercepts SIGINT and SIGTERM signals.

Usage

Installation

  1. Install the required dependencies
bun add @nurodev/astro-bun
  1. Add the integration to your astro config
+import bun from "@nurodev/astro-bun";

export default defineConfig({
+ 	adapter: bun(),
+ 	output: "hybrid",
});
  1. Update your package.json start script
{
	"scripts": {
-		"start": "astro dev"
+		"start": "bun run ./dist/server/entry.mjs"
	}
}

Contributing

This package is structured as a monorepo:

  • playground contains code for testing the package
  • package contains the actual package

Install dependencies using pnpm:

bun i --frozen-lockfile

Start the playground and package watcher:

bun dev

You can now edit files in package. Please note that making changes to those files may require restarting the playground dev server.

Licensing

MIT Licensed. Made with ❤️ by Ben Dixon.

Credits

  • @ido-pluto, and subsequently @andremralves: This project is massively based on astro-bun-adapter on but with some improvements added.
  • @florian-lefebvre: The structure & a lot of copy text is based on their astro-integration-template project template.

Package Sidebar

Install

npm i @nurodev/astro-bun

Weekly Downloads

24

Version

1.1.5

License

MIT

Unpacked Size

127 kB

Total Files

7

Last publish

Collaborators

  • nurodev