Last 12 weeks · 0 commits
2 of 6 standards met
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.
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.
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.