/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-using-with-vite-061ad04cdd82-using-with-vite-s0196-c0000.md
Using with Vite - hono-docs
Using with Vite Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt using with vite Summary When usin...
Using with Vite
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#using-with-vite
Summary
When using Hono with Vite, you should disable Vite's built-in CORS feature by setting server.cors to false in your vite.config.ts. This prevents conflicts with Hono's CORS middleware. ```ts // vite.config.ts import { cloudflare } f...
Content
When using Hono with Vite, you should disable Vite's built-in CORS feature by setting server.cors to false in your vite.config.ts. This prevents conflicts with Hono's CORS middleware.
// vite.config.ts
import { cloudflare } from '@cloudflare/vite-plugin'
import { defineConfig } from 'vite'
export default defineConfig({
server: {
cors: false, // disable Vite's built-in CORS setting
},
plugins: [cloudflare()],
})