@hono/vite-dev-server weekly downloads statistics
By hono (2 listings) · npm · Vite plugins
Vite dev-server plugin for Hono
@hono/vite-dev-server has 322,306 recorded weekly downloads on npm, an increase of 8.9% over the past 30 days, ranking #455 of 3,247 tracked listings.
About @hono/vite-dev-server
@hono/vite-dev-server
@hono/vite-dev-server is a Vite Plugin that provides a custom dev-server for fetch-based web applications like those using Hono.
You can develop your application with Vite. It's fast.
Features
- Support any
fetch-based applications. - Hono applications run on.
- Fast by Vite.
- HMR (Only for the client side).
- Adapters are available, e.g., Cloudflare.
- Also runs on Bun.
Demo
https://github.com/honojs/vite-plugins/assets/10682/a93ee4c5-2e1a-4b17-8bb2-64f955f2f0b0
Supported applications
You can run any application on @hono/vite-dev-server that uses fetch and is built with Web Standard APIs. The minimal application is the following.
export default {
fetch(_request: Request) {
return new Response('Hello Vite!')
},
}
This code can also run on Cloudflare Workers or Bun. And if you change the entry point, you can run on Deno, Vercel, Lagon, and other platforms.
Hono is designed for fetch-based applications like this.
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello Vite!'))
export default app
So, any Hono application will run on @hono/vite-dev-server.
Usage
Installation
You can install vite and @hono/vite-dev-server via npm.
npm i -D vite @hono/vite-dev-server
Or you can install them with Bun.
bun add vite @hono/vite-dev-server
Settings
Add "type": "module" to your package.json. Then, create vite.config.ts and edit it.
import { defineConfig } from 'vite'
import devServer from '@hono/vite-dev-server'
export default defineConfig({
plugins: [
devServer({
entry: 'src/index.ts', // The file path of your application.
}),
],
})
Development
Just run vite.
npm exec vite
Or
bunx --bun vite
Options
The options are below.
export type DevServerOptions = {
entry?: string
export?: string
injectClientScript?: boolean
exclude?: (string | RegExp)[]
ignoreWatching?: (string | RegExp)[]
adapter?: {
env?: Env
onServerClose?: () => Promise<void>
}
handleHotUpdate?: VitePlugin['handleHotUpdate']
base?: '' | `/${string}`
}
Default values:
export const defaultOptions: Required<Omit<DevServerOptions, 'cf'>> = {
entry: './src/index.ts',
injectClientScript: true,
exclude: [
/.*\.css$/,
/.*\.ts$/,
/.*\.tsx$/,
/^\/@.+$/,
/\?t\=\d+$/,
/^\/favicon\.ico$/,
/^\/static\/.+/,
/^\/node_modules\/.*/,
],
ignoreWatching: [/\.wrangler/],
handleHotUpdate: ({ server, modules }) => {
const isSSR = modules.some((mod) => mod.ssrModule)
if (isSSR) {
server.hot.send({ type: 'full-reload' })
return []
}
},
base: '/',
}
injectClientScript
If it's true and the response content type is "HTML", inject the script that enables Hot-reload. default is true.
exclude
The paths that are not served by the dev-server.
If you have static files in public/assets/* and want to return them, exclude /assets/* as follows:
import devServer, { defaultOptions } from '@hono/vite-dev-server'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [
devServer({
exclude: ['/assets/*', ...defaultOptions.exclude],
}),
],
})
ignoreWatching
You can add target directories for the server to watch.
adapter
You can pass the env value of a specified environment to the application.
base
The base option specifies the base path under which your application is served. It provides behavior equivalent to Hono's .basePath(), but does not depend on Hono itself. Note that c.req will contain paths without the base you specify here.
Provide an empty string or / to serve from the root, or a leading-slash path such as /foo/bar.
When this option is set, the Vite base configuration will be overridden by the vite-dev-server.
For example, if you set base to /foo/bar, when a browser requests /foo/bar/path the vite-dev-server will handle that request and pass /path to your application.
import { defineConfig } from 'vite'
import devServer from '@hono/vite-dev-server'
export default defineConfig({
plugins: [
devServer({
entry: 'src/index.tsx',
base: '/foo/bar', // The app runs under '/foo/bar'
}),
],
})
Adapter
Cloudflare
You can pass the Bindings specified in wrangler.toml to your application by using "Cloudflare Adapter".
Install miniflare and wrangler to develop and deploy your cf project.
npm i -D wrangler miniflare
import devServer from '@hono/vite-dev-server'
import cloudflareAdapter from '@hono/vite-dev-server/cloudflare'
import { defineConfig } from 'vite'
export default defineConfig(async () => {
return {
plugins: [
devServer({
adapter: cloudflareAdapter,
}),
],
}
})
Node.js & Bun
No additional dependencies needed.
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,
}),
],
}
})
Helper
ConnInfo
You can use the ConnInfo helper to get connection information. For more details: ConnInfo Helper.
You can use it like this:
import { Hono } from 'hono'
import { getConnInfo } from '@hono/vite-dev-server/conninfo'
const app = new Hono()
app.get('/', (c) => {
const info = getConnInfo(c) // info is `ConnInfo`
return c.text(`Your remote address is ${info.remote.address}`)
})
You can also use different ConnInfo Helpers in development and production environments as shown below:…
Description from the npm listing.
- hono
- vite-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Vite plugins plugins
All 20 @hono/vite-dev-server alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@hono/vite-dev-server. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.