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
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:
Today this works only if users add a separate root Vite plugin:
But it would be helpful for a Nitro module used through
nitro/viteto expose that dev-only Vite integration automatically, so users can keep:Possible shape:
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