Replies: 1 comment 1 reply
-
FWIW the new monorepo support in ShadCN will create a new monorepo for a new NextJS project that has decent defaults. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
I've spent a lot of time researching how to use Next.js v13 in TypeScript monorepo, and I haven't found much guidance. In fact, I've found conflicting recommendations.
Googling "TypeScript monorepo" leads to many articles12 that recommend using TypeScript's Project References feature (PREFs), which involves enabling
composite
intsconfig.json
, as well as specifying all TypeScript dependencies in thereferences
field. However, as @kirill-konshin pointed out here, PREFs are not compatible with Next.js (given that Next.js uses a different compiler, which at the moment is SWC).Conversely, googling "Next.js monorepo" leads to several different approaches. The two that stand out are:
Questions
Given the above, I have the following questions for the Vercel team:
P.S. it seems to me that Next.js forces monorepo users to create a dichotomy between (i) development-only TypeScript configs and (ii) production TypeScript configs. And I think it would be worth documenting this requirement in the TypeScript section in your docs.
Additional information
@Victordmdb asked the same question here, but he has never received an answer.
Footnotes
https://dev.to/mxro/the-ultimate-guide-to-typescript-monorepos-5ap7 ↩
https://earthly.dev/blog/setup-typescript-monorepo/ ↩
Beta Was this translation helpful? Give feedback.
All reactions