You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot override specific hooks once the preset already registered the same hook #1382
Originally posted by igorjacauna July 2, 2023
I would like to use the compiled hook but if I use a preset, my hook overwrites the preset hook. So, the preset hook is not called, only my hook configured in nitro.options.hooks.compiled
Hi. This is an internal limitation with Nitro config merging only. Hookable even has utils for this. The fix should be straightforward but since some presets currently shadow their base preset hooks, this should be handled with extra care.
changed the title [-]Is it possible to use specific nitro hooks once the preset already registered the same hook?[/-][+]Cannot override specific hooks once the preset already registered the same hook[/+]on Jul 3, 2023
Activity
Hebilicious commentedon Jul 3, 2023
I can confirm that this behaviour happens on my end too.
Adding a custom "compiled" hook overwrite the preset one. I'm not sure if this intended.
igorjacauna commentedon Jul 3, 2023
Thanks for help!
I don't known if this should be something to discuss in unjs/hookable also or it's only about how Nitro handle this hooks with hookable.
pi0 commentedon Jul 3, 2023
Hi. This is an internal limitation with Nitro config merging only. Hookable even has utils for this. The fix should be straightforward but since some presets currently shadow their base preset hooks, this should be handled with extra care.
[-]Is it possible to use specific nitro hooks once the preset already registered the same hook?[/-][+]Cannot override specific hooks once the preset already registered the same hook[/+]