Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/patterns/fullstack-dev-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ import { Elysia } from 'elysia'
import { staticPlugin } from '@elysiajs/static'

new Elysia()
.use(await staticPlugin()) // [!code ++]
.use(await staticPlugin({ // [!code ++]
bunFullstack: true // [!code ++]
})) // [!code ++]
.listen(3000)
```

Expand All @@ -45,6 +47,12 @@ Notice that we need to add `await` before `staticPlugin()` to enable Fullstack D
This is required to setup the necessary HMR hooks.
:::

:::warning
You also need to pass `bunFullstack: true` option to `staticPlugin()` to enable Bun's HTML bundler.

Without it, `.tsx` files referenced in your HTML are served as raw text, causing the browser to throw `SyntaxError`.
:::
Comment on lines +50 to +54
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether static plugin docs mention bunFullstack/bundleHTML
rg -n -C2 'bunFullstack|bundleHTML|## Config|###' docs/plugins/static.md docs/patterns/fullstack-dev-server.md

Repository: elysiajs/documentation

Length of output: 2742


🏁 Script executed:

cat docs/plugins/static.md | head -120 | tail -80

Repository: elysiajs/documentation

Length of output: 1813


🏁 Script executed:

rg -n 'bunFullstack|bundleHTML' docs/plugins/static.md

Repository: elysiajs/documentation

Length of output: 48


Update static.md to document the bunFullstack option, you careless reviewer~♡

The warning here is totally right, but you forgot to document bunFullstack in docs/plugins/static.md! The Config section lists assets, prefix, ignorePatterns, and all that boring stuff, but bunFullstack is conspicuously missing. Readers will look at the plugin docs and think this guide is full of it ♡

Add bunFullstack to the Config section in docs/plugins/static.md so people aren't left confused~

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/patterns/fullstack-dev-server.md` around lines 50 - 54, Add
documentation for the bunFullstack option to the Config section of
docs/plugins/static.md: describe the boolean bunFullstack flag, its default
value, that it must be set to true when using Bun's HTML bundler so .tsx/.jsx
referenced in HTML are compiled instead of served as raw text, and show its
usage example when calling staticPlugin({ ..., bunFullstack: true }). Also
mention the runtime effect (enables Bun's HTML bundler integration) and any
related caveats with staticPlugin().


2. Create **public/index.html** and **index.tsx**

::: code-group
Expand Down Expand Up @@ -116,7 +124,8 @@ import { staticPlugin } from '@elysiajs/static'
new Elysia()
.use(
await staticPlugin({
prefix: '/' // [!code ++]
prefix: '/', // [!code ++]
bunFullstack: true
})
)
.listen(3000)
Expand Down