-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support modules to extend nitro builder #1789
Conversation
Thanks for picking up on it and nice you could take inspiration from the Nuxt module. If you would like to work on your PR to be landed, i have added few comments to minify changes. Many of APIs and consideration in Nuxt happened over time and some based on legacy requirements we don't need to Nitro... |
Thanks! πͺ I update this PR a little and allow modules to be specify in a |
I expect as simple as this: import type { NitroModule } from 'nitropack'
export default <NitroModule>{ async setup(nitro) {} } Let's not keep ahead of ourselves. This feature is initially intended for advanced use cases not user-facing as Nuxt modules are until we can figure out use-cases :) |
Codecov Report
@@ Coverage Diff @@
## main #1789 +/- ##
==========================================
- Coverage 52.38% 52.28% -0.11%
==========================================
Files 170 172 +2
Lines 11806 11882 +76
Branches 910 908 -2
==========================================
+ Hits 6185 6212 +27
- Misses 5525 5573 +48
- Partials 96 97 +1
|
So I think this PR is ready for a review! |
it is globally available. encouraging import from main package can lead to later hoist issues
π Linked issue
fix #1788
β Type of change
π Description
This PR introduce the concept of modules like in Nuxt.
nitro.config
filemodules
directoryThis PR is a first implementation. depending of the usage, we will update the modules feature.
π Checklist