An Astro adapter to deploy your SSR site to Bun targets
astro-bunThis adapter allows Astro to deploy your SSR site to Bun targets.
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 intercepts SIGINT and SIGTERM signals.
1. Install the required dependencies
``bash`
bun add @nurodev/astro-bun
2. Add the integration to your astro config
`diff
+import bun from "@nurodev/astro-bun";
export default defineConfig({
+ adapter: bun(),
+ output: "server",
});
`
3. Update your package.json start script
`diff`
{
"scripts": {
- "start": "astro dev"
+ "start": "bun run ./dist/server/entry.mjs"
}
}
This package is structured as a monorepo:
- playground contains code for testing the packagepackage
- contains the actual package
Install dependencies using Bun:
`bash`
bun i --frozen-lockfile
Start the playground and package watcher:
`bash`
bun dev
You can now edit files in package. Please note that making changes to those files may require restarting the playground dev server.
MIT Licensed. Made with ❤️ by Ben Dixon.
- @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.