/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-client-side-b75933f1f06d-client-side-s0477-c0000.md
Client-side (1) - hono-docs
Client side (1) Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt client side Summary You can write...
Client-side (1)
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#client-side
Summary
You can write client-side scripts and import them into your application using Vite's features. If /src/client.ts is the entry point for the client, simply write it in the script tag. Additionally, import.meta.env.PROD is useful for d...
Content
You can write client-side scripts and import them into your application using Vite's features.
If /src/client.ts is the entry point for the client, simply write it in the script tag.
Additionally, import.meta.env.PROD is useful for detecting whether it's running on a dev server or in the build phase.
app.get('/', (c) => {
return c.html(
<html>
<head>
{import.meta.env.PROD ? (
<script type='module' src='/static/client.js'></script>
) : (
<script type='module' src='/src/client.ts'></script>
)}
</head>
<body>
<h1>Hello</h1>
</body>
</html>
)
})In order to build the script properly, you can use the example config file vite.config.ts as shown below.