root
Environment: server.
⚠️This is a beta feature.
If you use config.telefuncFiles
, then you also need to set config.root
.
The config.root
setting is only needed if you use config.telefuncFiles
.
You usually define server-side configs (
import { config } from 'telefunc'
) at your server entry. For example if you use Express.js:
Monorepo
If you have a monorepo structure, then set config.root
to the root directory of your client-side (i.e. the root of Vite/Vike/Next.js/Nuxt/...). Don't set config.root
to the monorepo root, nor to the root directory of your server. (The config.root
setting enables Telefunc to match your .telefunc.js
files/imports between the server-side and the client-side.)