Closed manniL closed 2 months ago
PR is welcome to implement this feature. We might also introduce a new dev
flag to the event handler object type and allow programmatic registration of them.
Resolved via https://github.com/unjs/nitro/pull/2272 (nitro nightly at the moment)
Describe the feature
Hey all 👋🏻
An equivalent of e.g. Nuxt's
<DevOnly>
component for Nitro would be interesting and could be the.dev.ts
suffix. All routes having a.dev
suffix in the file would only be loaded during development and would not be present in production.Benefits would be automatic removal on production and being able to define e.g. debug endpoints in your dev environment 🙌
Related: https://github.com/nuxt/nuxt/issues/18730
Additional information