N
Nuxt10mo 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
rickygOP10mo 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
manniL10mo ago
(As written in the discussion - PR welcome!)

Did you find this page helpful?