Blog Post Title
{/* The prism package and its tokenization logic are shipped to the client */}
{({ className, style, tokens, getLineProps, getTokenProps }) => (
{tokens.map((line, i) => (
{line.map((token, key) => (
))}
))}
)}
)
}
```
This increases bundle size because the client must download and execute the highlighting library, even though the result is static HTML.
Instead, move the highlighting logic to a Server Component and render the final HTML on the server. The client will only receive the rendered markup.
```tsx filename="app/blog/[slug]/page.tsx"
import { codeToHtml } from 'shiki'
export default async function Page() {
const code = `export function hello() {
console.log("hi")
}`
// The Shiki package runs on the server and is never bundled for the client.
const highlightedHtml = await codeToHtml(code, {
lang: 'tsx',
theme: 'github-dark',
})
return (