You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HonoX consists of a Hono instance and Vite configuration, so it can be deployed on any platform that Hono supports.
933
+
[`@hono/vite-build`] provides build configurations for Cloudflare Workers, Node.js, Bun, and many other platforms.
934
+
935
+
### Cloudflare Workers
936
+
937
+
If you create a project using the `create-hono` command and select `x-basic`, the configuration for deploying to Cloudflare Workers is already included by default.
Deploy with the following commands after the build. Ensure you have [Wrangler](https://developers.cloudflare.com/workers/wrangler/) installed:
986
+
987
+
```sh
988
+
wranglerdeploy
989
+
```
990
+
991
+
### On-Premises or Other Platforms
992
+
993
+
You can build the HonoX app for on-premises environments or various other platforms. See the [`@hono/vite-build`] README for a full list of supported platforms. For example, you can make it for the Bun:
994
+
995
+
```ts
996
+
// vite.config.ts
997
+
importbuildfrom'@hono/vite-build/bun'// Change to Bun
998
+
importadapterfrom'@hono/vite-dev-server/bun'// Change to Bun
999
+
importtailwindcssfrom'@tailwindcss/vite'
981
1000
importhonoxfrom'honox/vite'
982
-
importbuildfrom'@hono/vite-build/bun'
1001
+
import{ defineConfig } from'vite'
983
1002
984
1003
exportdefaultdefineConfig({
985
-
plugins: [honox(), build()],
1004
+
plugins: [
1005
+
honox({
1006
+
devServer: { adapter },
1007
+
client: { input: ['./app/style.css'] }
1008
+
}),
1009
+
tailwindcss(),
1010
+
build()
1011
+
]
986
1012
})
987
1013
```
988
1014
1015
+
Build command (including a client):
1016
+
1017
+
```sh
1018
+
vitebuild--modeclient&&vitebuild
1019
+
```
1020
+
1021
+
Run the server with Bun:
1022
+
1023
+
```sh
1024
+
cd ./dist&&bunindex.js
1025
+
```
1026
+
1027
+
**Note**: When running on-premises, make sure to change the working directory to the output directory (e.g., `cd ./dist`). Otherwise, JavaScript, CSS, and static assets may not be resolved correctly.
0 commit comments