Open oscartbeaumont opened 10 months ago
Latest commit: f850a06f753ee9ad95c9ca293683621a63e11fe5
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The include
rule will be really useful!
Sometimes I just need Hono to handle a few routes that don't have a common prefix, and leave all the rest to be handled by Vite dev server locally and served as static content on Cloudflare Pages. This is really tricky to achieve with only exclude
rules.
@yusukebe looking forward to having this option!
Hi @oscartbeaumont !
Sorry for the delay. This is awesome!
I think it can be factored, but I would like you to write tests first. This project has e2e tests, so please add the tests there.
https://github.com/honojs/vite-plugins/tree/main/packages/dev-server/e2e
Thanks!
Are there any updates for this pr to get merged?
include
is the opposite of the existingexclude
functionality.middleware
can run prior to parsing the request onto Vite and can returnResponse
orundefined
.undefined
will pass the request onto Vite while aResponse
will be directly returned to the client.This could be used for a manual Hono integration which could run any code to decide what to serve.