Why is common-i18n a package instead of static assets? #1928
-
Hey again, I noticed there is a new package https://github.com/belgattitude/nextjs-monorepo-example/tree/main/packages/common-i18n I wonder if there is any specific reason for making it a package as opposed to storing the JSON locale files as shared static assets that could be consumed by all packages/apps (like images)? Is it to make the type definitions available? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
By declaring the package it becomes part of the dependency graph (topology). While it's not very much useful in this example repo (a fair starter), it will allow yarn / turbo / nx to compute changes and affected packages. In other words, a change in locales will trigger a build on workspaces that depends on it. The images static folder was a quick hack, I'll update when I have time. Ps: yes Sharing typings, enabling specific linters... are also part of the reason |
Beta Was this translation helpful? Give feedback.
By declaring the package it becomes part of the dependency graph (topology).
While it's not very much useful in this example repo (a fair starter), it will allow yarn / turbo / nx to compute changes and affected packages.
In other words, a change in locales will trigger a build on workspaces that depends on it.
The images static folder was a quick hack, I'll update when I have time.
Ps: yes Sharing typings, enabling specific linters... are also part of the reason