GitShow/vitejs/vite-ts-monorepo-rfc
vitejs

vite-ts-monorepo-rfc

An RFC for better support for TS monorepos in Vite

by vitejs
Star on GitHubForknpm

TypeScript

150 stars7 forks1 contributorQuiet · 2y agoSince 2024

Meet the team

See all 1 on GitHub →
yyx990803
yyx9908031 contribution

Languages

View on GitHub →
TypeScript92.5%
HTML7.5%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
50
✓README○License○Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 1 in progress · Last activity 2y ago
See all on GitHub →
Danielku15
All solutions have one problem: you must use relative importsOpenIssue

I stumbled over this RFC researching solutions for the problem described in this repo: how to best use source-sharing within a mono repo to avoid a build step for cross references. While most solutions sound promising there is a key problem to all of them: You must use relative path or imports for all imports within a package. If you use absolute paths or package specific ts-paths things fall apart. Here a simplified example of what I mean: Depending on what paths you use for imports, the imports will fail at some point: 1/1, 1/2, 1/3: import of '@brand/lib1/fun2' already fails because points to the lib2 sources 2/1, 2/2, 2/3: import of '@brand/lib1/fun2' already fails because points to the lib2 sources 3/1: import of '@brand/lib1/fun2' works, but import of '@src/shared' fails because points to the lib2 sources. 3/2: import of '@brand/lib1/fun2' works, but import of 'src/shared' fails because points to the lib2 sources. 3/3 import of '@brand/lib1/fun2' works and import of './shared' I didn't test this through but I also expect things get tricky regarding automatic imports by the IDE. I guess you either need to ensure relative paths or you use the full syntax across the whole codebase. Happy to hear any inputs how this challenge can be solved.

Danielku15 · 4mo ago
stefnotch
Does not find all referencesOpenIssue

I'm sure that the excellent Vite team is already aware of this, but I figured it'd be worth mentioning again: When opening , and then trying to do "find all references", it fails to find the references in . The same holds true for other project-wide analysis tasks, like "rename symbol". Manually opening the other project to force-load it does work. This limitation makes these approaches very hard to use in a monorepo.

stefnotch · 1y ago
bordeo
use source only on devOpenPR
bordeo · 1y ago
Structured data for AI agents

Repository: vitejs/vite-ts-monorepo-rfc. Description: An RFC for better support for TS monorepos in Vite Stars: 150, Forks: 7. Primary language: TypeScript. Languages: TypeScript (92.5%), HTML (7.5%). Open PRs: 1, open issues: 5. Last activity: 2y ago. Community health: 50%. Top contributors: yyx990803.

·@ofershap

Replace github.com with gitshow.dev