N
Nuxt11mo ago
jwishnie

Directory for utils for both Server and Client?

utils is for utility code for the client side server/utils is for utility code for the server side What's the right place for utility code I want to use in both the client and the server??
1 Reply
Phillip
Phillip10mo ago
You have to import and re-export it. Like this /utils/buildTargetAudience.ts (client util)
import { buildTargetAudience } from '@/server/utils/buildTargetAudience'
export default buildTargetAudience
import { buildTargetAudience } from '@/server/utils/buildTargetAudience'
export default buildTargetAudience

Did you find this page helpful?