Replies: 2 comments 1 reply
-
Are you trying to reduce the translation json file size? If yes, then it traditionally has never been a bottleneck and it also has a very high TTL. I'd recommend you throw it on the CDN, do versioning, load it separately and treat it as any other assets. |
Beta Was this translation helpful? Give feedback.
-
Encountering a similar situation that is also related to: #2786 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The extract function of the CLI allows passing a glob of files to extract messages from. I think it would be useful to have the option to recursively dig into a file's imports to pull out all relevant translations.
This would be useful for generating translation files per-page, assuming each page is represented by a top-level component. For example, this would help in reducing the initial bundle size for an SSR rendered Next.js page.
It may be possible to do this using the Node API, globby, and tools to parse/resolve modules like
detective-typescript
,@babel/parser
and/or the TS Compiler.Is there a current solution for this, or things others have tried to make this work?
Beta Was this translation helpful? Give feedback.
All reactions