Allow Nitro modules to register Vite DevTools integrations
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
Describe the feature
When using nitro/vite, it would be useful if Nitro modules could contribute integrations to the outer Vite plugin context.
A concrete case is Vite DevTools. A Nitro module can register server routes during Nitro setup, but it cannot currently register a Vite DevTools panel because that requires a root Vite plugin with:
{
devtools: {
setup(ctx) {
ctx.docks.register(...)
}
}
}
Today this works only if users add a separate root Vite plugin:
plugins: [
DevTools(),
someVitePluginWithDevtools(),
nitro(),
]
But it would be helpful for a Nitro module used through nitro/vite to expose that dev-only Vite integration automatically, so users can keep:
plugins: [
DevTools(),
nitro(),
]
Possible shape:
- allow Nitro modules to contribute outer Vite plugins
- or expose a specific hook for Vite DevTools integrations
- or provide another recommended interop path for this case
Is there already a supported way to do this? If not, would Nitro be open to a small PR for this kind of interop?
Related context:
Additional information
- Would you be willing to help implement this feature?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the nitro/vite integration and the Nitro module setup described in the issue. Review discussions 3680 and issue 3461 for existing interop decisions before choosing an implementation direction. Done means Nitro modules can provide the requested dev-only Vite DevTools integration through a supported, documented path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100