In my TypeScript monorepo utilizing NPM Workspaces, I have two packages: A and B.
Package B requires type definitions from package A.
To accomplish this, I included a reference to A's definition file in the tsconfig.json
of package B. However, something feels off:
{
"include": ["../a/types.d.ts", "next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
The relative reference bothers me. I expected it to work with a/types.d.ts
since "a" is the package name — but it doesn't seem to be functioning properly.
Could I be making a mistake somewhere?