mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
Implements static file serving for the Bun dev server, allowing files from configured directories (default: "public") to be served directly. Changes: - Add `static_dirs` field to Framework struct in bake.zig - Parse `staticDirs` option from framework configuration - Resolve static_dirs to absolute paths in Framework.resolve() - Enable "public" directory by default for React framework - Implement static file serving in DevServer.onRequest() - Static files are checked before framework routes - Files are served with correct MIME types - Supports nested directories and various file types - Add comprehensive tests for static file serving The implementation prioritizes static files over framework routes, similar to Next.js behavior. If a file exists in a static directory, it will be served instead of matching a dynamic route. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>