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
6.13k stars 503 forks source link

Rollup Build / Compiled Hooks not called in plugins #1325

Open barelyhuman opened 1 year ago

barelyhuman commented 1 year ago

Environment

nitropack: 2.4.1 Node: v18.16.0

Reproduction

https://github.com/barelyhuman/nitro-plug-hookable-hook-repo

Describe the bug

If wishing to run something before the rollup process starts or after it's compiled, the hooks are what I'd like to use but the hooks don't get called at all.

Additional context

No response

Logs

No response

danielroe commented 1 year ago

I do think we need a hook that allows modifying the rollup config. But having said that, the hooks exposed through nitro plugins are not build time hooks but runtime ones.

I would also love to see nitro 'modules' or 'build plugins' that allow extending nitro much as nuxt modules work.

barelyhuman commented 1 year ago

Though it'd be nice to have it in the documentation since there's already a PR handling the types I'll raise a PR for the doc update though