Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(dev-server): update README #169

Merged
merged 1 commit into from
Aug 28, 2024
Merged
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
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
Loading