Skip to content

Understanding why foo is mapped to foo/src in the nextjs branch #314

Answered by NiGhTTraX
PaulRBerg asked this question in Q&A
Discussion options

You must be logged in to vote

@PaulRBerg the nextjs branch is quite old , the latest NextJS example is under apps/nextjs.

Every example in apps/* uses path aliases to load dependencies from the monorepo source code, instead of from build artifacts, both when building and when running e.g. dev servers. This doesn't rely on node_modules symlinks, but on TypeScript's resolution mechanisms, and makes "Go to definition" work as expected.

Examples in packages/* do use node_modules symlinks to build artifacts, but only when building. See also https://github.com/NiGhTTraX/ts-monorepo/tree/1ee87c100a3bd65ebae4eb000c76354532f70c09#packages-vs-apps.

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
4 replies
@PaulRBerg
Comment options

@NiGhTTraX
Comment options

@PaulRBerg
Comment options

@PaulRBerg
Comment options

Answer selected by PaulRBerg
Comment options

You must be logged in to vote
5 replies
@PaulRBerg
Comment options

@NiGhTTraX
Comment options

@PaulRBerg
Comment options

@PaulRBerg
Comment options

@NiGhTTraX
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #313 on June 10, 2023 15:33.