N
Nuxt8mo ago
rickyg

How to Auto-Import a Server Function from a Nuxt Module?

How do you auto import a server function from a NUXT module into a Nuxt Server Application? Tried the following in module.ts 'addImportsDir(resolver.resolve("./runtime/server/utils"))' without success. I can auto-import into client side code all day long. What's the technique? Thank you.
2 Replies
rickyg
rickygOP8mo ago
I found a composable in Nuxt Kit addServerImportsDir that did the trick. May want to consider updating the Module Recipes Section on the Nuxt Website with an example. Thanks.
manniL
manniL8mo ago
(As written in the discussion - PR welcome!)
Want results from more Discord servers?
Add your server