'conditionally sending json data in nextjs
I want to create a small build using Nextjs. I have some big json files which are conditionally loaded by getStaticProps based on the language preference. I don't know if all these json files will be included in all builds for all languages or if only the conditionally selected ones will be sent to the client. If all json files are sent to the client no matter what, I was considering storing this data in a cms in order to reduce my final build. Is nextjs sending all json files to the client or only the ones that were either used in one of the pages/components or in getStaticProps?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
