Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

How the references work? #566

Answered by steveruizok
horizon0514 asked this question in Q&A
Discussion options

You must be logged in to vote

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 want import { Vec } from "@tldraw/vec" turning into imp…

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@sdwlig
Comment options

Answer selected by horizon0514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants