Skip to content

Commit

Permalink
docs(dev-server): update README (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe authored Aug 28, 2024
1 parent 044a023 commit 456078f
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions packages/dev-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ So, any Hono application will run on `@hono/vite-dev-server`.

You can install `vite` and `@hono/vite-dev-server` via npm.

```text
```bash
npm i -D vite @hono/vite-dev-server
```

Or you can install them with Bun.

```text
```bash
bun add vite @hono/vite-dev-server
```

Expand All @@ -82,13 +82,13 @@ export default defineConfig({

Just run `vite`.

```text
```bash
npm exec vite
```

Or

```text
```bash
bunx --bun vite
```

Expand Down Expand Up @@ -169,7 +169,7 @@ You can pass the Bindings specified in `wrangler.toml` to your application by us

Install miniflare and wrangler to develop and deploy your cf project.

```text
```bash
npm i -D wrangler miniflare
```

Expand All @@ -189,6 +189,30 @@ export default defineConfig(async () => {
})
```

### Node.js & Bun

No additional dependencies needed.

```ts
import devServer from '@hono/vite-dev-server'
import nodeAdapter from '@hono/vite-dev-server/node'
// OR
// import bunAdapter from '@hono/vite-dev-server/bun'
import { defineConfig } from 'vite'

export default defineConfig(async () => {
return {
plugins: [
devServer({
adapter: nodeAdapter,
// OR
// adapter: bunAdapter,
}),
],
}
})
```

## Client-side

You can write client-side scripts and import them into your application using Vite's features.
Expand Down Expand Up @@ -258,7 +282,7 @@ export default defineConfig(({ mode }) => {

You can run the following command to build the client script.

```text
```bash
vite build --mode client
```

Expand Down

0 comments on commit 456078f

Please sign in to comment.