How the references work? #566
-
https://github.com/tldraw/tldraw/blob/main/packages/core/src/inputs.ts#L4 Does anyone familiar with the tsconfig can help me? |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 2 replies
-
Hey, moving this over to discussion. You can read more about project references here. The problem with using paths in a monorepo is that they need to be cleaned up at build time, or else the aliases path will be present in the distributed types (which will not work for consumers). For example, tsc will leave an import like |
Beta Was this translation helpful? Give feedback.
Hey, moving this over to discussion. You can read more about project references here.
The problem with using paths in a monorepo is that they need to be cleaned up at build time, or else the aliases path will be present in the distributed types (which will not work for consumers). For example, tsc will leave an import like
import { Something } from "~types"
exactly like that, meaning we need to do the work ourselves of turning it into a relative path, e.g.import { Something } from "../../types"
. Using references allows us to script against .tsconfig without risking turning our monorepo imports into relative paths. We definitely dont wantimport { Vec } from "@tldraw/vec"
turning intoimp…