-
Notifications
You must be signed in to change notification settings - Fork 18
feat: support additional bun compile args and --bytecode compatibility #18
Copy link
Copy link
Open
Description
Problem
- There's no way to pass additional flags (e.g. --minify, --sourcemap, --bytecode) to bun build --compile during the adapter's
compile step. - The sveltekit server entry uses top-level await, which causes bun build --compile --bytecode to fail with:
error: "await" can only be used inside an "async" function - The gracefulShutdown handler runs twice on Ctrl+C because both SIGINT and SIGTERM fire, producing duplicate logs:
Stopping server...
Stopping server...
Stopped server
Stopped server
Proposed Changes
- All packages (sveltekit, nuxt, tanstack): Add a bunArgs option that passes additional flags to bun build --compile
- sveltekit: Wrap the server entry in an async IIFE to eliminate top-level await for --bytecode compatibility
- sveltekit: Add a guard to gracefulShutdown to prevent duplicate execution
Usage
// svelte.config.js
adapter({
bunArgs: ["--minify", "--sourcemap", "--bytecode"]
})Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels