astro-bunny-adapter
v0.2.4
Published
Astro adapter for bunny.net Edge Scripting
Readme
astro-bunny-adapter
Astro adapter for bunny.net Edge Scripting.
Deploy your Astro 6 app to bunny.net's edge network.
Installation
npm install astro-bunny-adapterUsage
// astro.config.mjs
import { defineConfig } from "astro/config";
import bunny from "astro-bunny-adapter";
export default defineConfig({
adapter: bunny(),
});Options
esbuild
Override or customize the esbuild config used to bundle the server output for bunny.net's edge runtime.
// Pass an object to merge with defaults
bunny({
esbuild: {
minify: true,
},
});
// Or pass a function for full control
bunny({
esbuild: (defaults) => ({
...defaults,
minify: true,
}),
});How it works
- Astro builds your app as usual (server-side rendered)
- After the build, the adapter re-bundles the server output with esbuild
targeting
platform: "browser"so it runs in bunny.net's Deno-based edge runtime - The server entrypoint uses
servePullZone().onOriginResponse()from the@bunny.net/edgescript-sdkto handle incoming requests through Astro's rendering pipeline
Requirements
- Astro 6
- Node.js >= 22.12.0
- A bunny.net account
License
MIT
