v3: defineNitroPlugin is not exported correctly
Hello,
During the migration to v3 I noticed that defineNitroPlugin is not exported from any nitro/* packages in the same way as defineTask or others.
The only way I've found for importing it now is import { defineNitroPlugin } from 'nitro/~internal/runtime/plugin';, which doesn't seem right since it references ~internal.
Is there some other expected way of importing defineNitroPlugin?
It is { definePlugin } from "nitro", likely it will be from "nitro/define" in next alphas.
Thank you! That works.
However I noticed that event type got lost now and it's typed as any in the example like this:
export default definePlugin((nitroApp) => {
nitroApp.hooks.hook('request', async (event) => { // <--- event is of a type any
});
});
Which is interesting. The whole nitroApp.hooks is of a type any, even though if I go into node modules I see that it's typed as hooks?: HookableCore<NitroRuntimeHooks>;. Perhaps hookable is not imported correctly?