dosyourself
dosyourself
Explore posts from servers
NNuxt
Created by dosyourself on 6/25/2024 in #❓・help
Prevent developers from using secrets in client-side code
I've read up on server only components/etc, but it's not immediately clear to me if there is a way to prevent developers from accidentally using server code in the client. Is there anything that Nuxt does to prevent this similar to what SvelteKit does here https://kit.svelte.dev/docs/server-only-modules#how-it-works ? Basically, just want to disallow importing or invoking functions from the server directory in the client outside of fetching the endpoint.
5 replies