diff options
author | 2023-05-30 20:48:37 -0700 | |
---|---|---|
committer | 2023-05-30 20:48:37 -0700 | |
commit | 84d5794477fb0f36ea293eb2f0a5811a84a71ff4 (patch) | |
tree | 490dd293c78b58b302aa1879d807f9e126438e7b /docs/rfcs/bun-app.tsx | |
parent | d3d22dc4f7303a4ac2817b4384693f42acc8849d (diff) | |
download | bun-rfc/bun-bundler-api.tar.gz bun-rfc/bun-bundler-api.tar.zst bun-rfc/bun-bundler-api.zip |
Updatesrfc/bun-bundler-api
Diffstat (limited to 'docs/rfcs/bun-app.tsx')
-rw-r--r-- | docs/rfcs/bun-app.tsx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/docs/rfcs/bun-app.tsx b/docs/rfcs/bun-app.tsx index c8926253d..92e7bef41 100644 --- a/docs/rfcs/bun-app.tsx +++ b/docs/rfcs/bun-app.tsx @@ -1,13 +1,27 @@ import { FileSystemRouter, MatchedRoute, ServeOptions, Server } from "bun"; -import { BuildManifest, BuildConfig, BundlerConfig } from "./bun-build-config"; +import { BuildManifest, BuildConfig } from "./bun-build-config"; import { BuildResult } from "./bun-build"; interface AppConfig { - configs: Array<BuildConfig & { name: string }>; + configs: Array<Omit<BuildConfig, "entrypoints"> & { name: string }>; routers: Array<AppServeRouter>; } +/** + * + * Bun.App + * + * On build/serve: + * - iterate over all routers + * - each router specifies either an `entrypoint`/`dir` & build config + * - if dir, all files in entrypoint are considered entrypoints + * - everything is built + * - the built results are served over HTTP + * - each router has a route `prefix` from which its build assets are served + * - for "mode: handler", the handler is loaded and called instead of served as a static asset + */ + type AppServeRouter = | { // handler mode |