Sveltekit Adapter Bun screenshot

Sveltekit Adapter Bun

Author Avatar Theme by Bun community
Updated: 21 Oct 2022
22 Stars

Overview:

The @bun-community/sveltekit-adapter-bun is a module that serves as an adapter for SvelteKit apps, generating a standalone Bun server. It is important to note that this module is experimental and may not work with certain features like FormData.

Features:

  • Standalone Bun server generated for SvelteKit apps.
  • Easy installation with the bun add command or npm.
  • Integration with SvelteKit configuration file.
  • Support for websockets using Bun’s websocket server.
  • Customizable options for the adapter, such as directory location, asset browsing, precompressing, file extensions, and more.
  • Configuration through environment variables.

Installation:

To install the @bun-community/sveltekit-adapter-bun module, you can use either the bun add command or npm. Here are the steps to follow:

  1. Install the module with the following command:

    • bun add -d @bun-community/sveltekit-adapter-bun
    • or npm i -D @bun-community/sveltekit-adapter-bun
  2. Add the adapter to your SvelteKit configuration file (svelte.config.js).

  3. After building the server using “vite build”, start the server using the provided command.

Summary:

The @bun-community/sveltekit-adapter-bun module is an experimental adapter for SvelteKit apps that generates a standalone Bun server. It provides integration with SvelteKit configuration and offers customization options for the adapter. However, it may not support certain features like FormData. Installation is easy using either the bun add command or npm, and the server can be started after building with a specific command. Overall, this module provides a convenient solution for incorporating the Bun server into SvelteKit apps.