Server seperation
We can use createServerFn to create functions which are callable but not directly part of the client bundle (as far as I understand).
How do we create server side functions which are NOT callable by the client? For server side utilities and common functionality.
3 Replies
foreign-sapphire•6mo ago
You should be able to split correctly, but if you wanna be super sure you might include a vite plugin called
vite-env-only
and have it configured like this:
environmental-roseOP•6mo ago
Hey, thanks for suggestion! Will look into plugin and config.
foreign-sapphire•6mo ago
Your welcome, in this example it will deny importing to client those imports + the folders / files i mentioned there. like anything from services except the types, so this give me confidence that nothing on the services ( business logic ) should ever leak into the client