nx-vite-ts-paths plugin (#29472)
The fallback path resolution was only happening if the resolvedFile was a falsy value, so it was returning inexistent filepaths. This pull request includes a small but important change to the `packages/vite/plugins/nx-tsconfig-paths.plugin.ts` file. The change improves the reliability of resolving file paths by checking if the resolved path exists before proceeding with fallback file matching. * [`packages/vite/plugins/nx-tsconfig-paths.plugin.ts`](diffhunk://#diff-ad026b24ed45d9df484cabc7e277fc9b4d7759560af36bf357cbc4186725ae0bL174-R176): Added a check to verify if the resolved file path exists before using fallback file matching. * <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> The resolver doesn't resolve the full file path, it ignores the file extension. For example, for a path like this: `import mergeClassNames from '@projects/global/utils/mergeClassNames'` It resolves to `absolutePath.../projects/libs/global/src/utils/mergeClassNames` When vite is building a project, it doesn't find the file and it errors. This happens because the resolved file path is not a falsy value, thus, it doesn't run the fallback file path matching. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> What is expected is that it resolves to (notice the file extension) `absolutePath.../projects/libs/global/src/utils/mergeClassNames.ts` ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> --------- Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
nx-vite-ts-paths plugin (#29472)
node-fetch dependency (#29568)
node-fetch dependency (#29568)
node-fetch dependency (#29568)
Smart Monorepos · Fast CI
Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
Create a new Nx workspace with
npx create-nx-workspace
...or run
npx nx init
to add Nx to your existing workspace to get faster task scheduling, caching and more. More in the docs.
Learn about CI with Nx Cloud
Nx Cloud connects directly to your existing CI setup, helping you scale your monorepos on CI by leveraging remote caching, task distribution across multiple machines, automated e2e test splitting and automated task flakiness detection
Connect your existing Nx workspace with
npx nx connect
Learn more in the Nx CI docs »
Useful links
Want to help?
If you want to file a bug or submit a PR, read up on our guidelines for contributing and watch this video that will help you get started.

Core Team
| Victor Savkin | Jason Jean | Benjamin Cabanes | Jack Hsu |
|---|---|---|---|
| vsavkin | FrozenPandaz | bcabanes | jaysoo |
| James Henry | Jon Cammisuli | Isaac Mann | Juri Strumpflohner |
|---|---|---|---|
| JamesHenry | cammisuli | isaacplmann | juristr |
| Philip Fulcher | Caleb Ukle | Katerina Skroumpelou | Colum Ferry |
|---|---|---|---|
| philipjfulcher | barbados-clemens | mandarini | Coly010 |
| Emily Xiong | Miroslav Jonaš | Leosvel Pérez Espinosa | Zachary DeRose |
|---|---|---|---|
| xiongemi | meeroslav | leosvelperez | ZackDeRose |
| Craigory Coppola | Chau Tran | Nicholas Cunningham | Max Kless |
|---|---|---|---|
| AgentEnder | nartc | ndcunningham | MaxKless |