unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

more explicit way of adding modules #2691

Open pi0 opened 1 month ago

pi0 commented 1 month ago

Background: some thoughts here.

Nitro modules should be explicitly imported and configured in the user config. Pretty much how a rollup or vite plugin can be configured.

While this is a breaking change for v3, we never publicly documented modules feature and initial support was also added as an advanced feature. This pattern is also tried on nitro-cloudflare-dev module and proven to work nice.