@nurodev/astro-bun
v2.0.3
Published
An Astro adapter to deploy your SSR site to Bun targets
Downloads
650
Maintainers
Readme
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:
- 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 interceptsSIGINT
andSIGTERM
signals.
Usage
Installation
- Install the required dependencies
bun add @nurodev/astro-bun
- Add the integration to your astro config
+import bun from "@nurodev/astro-bun";
export default defineConfig({
+ adapter: bun(),
+ output: "server",
});
- 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 packagepackage
contains the actual package
Install dependencies using Bun:
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.