-
"getServerSideProps always runs server-side and the code is automatically tree-shaken from browser bundles, ensuring that less code is sent to the browser. " Anyone have recommendations on tools or approaches to make sure server-only code (esp. secrets) have been properly excluded from client bundles? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @geeschmidt! We're currently planning on releasing a tool to preview the output so you can verify everything is treeshaken as expected. I'll update this discussion when that happens. If you need us to manually help you verify some code, feel free to post it here (we can provide the "would-be-bundled" output)! Regarding secrets, there is an open RFC to ensure secrets are not exposed in the bundle themselves: #11106 |
Beta Was this translation helpful? Give feedback.
-
@geeschmidt here's a website you can use to see the output of what Next.js will tree shake: |
Beta Was this translation helpful? Give feedback.
@geeschmidt here's a website you can use to see the output of what Next.js will tree shake:
https://next-code-elimination.now.sh/