Open Diboby opened 1 week ago
Hello !
The @nx/vite/plugins/nx-tsconfig-paths.plugin path resolution is not working as expected.
@nx/vite/plugins/nx-tsconfig-paths.plugin
I think the first tsconfig is supposed to be the project tsconfig (https://github.com/nrwl/nx/blob/master/packages/vite/plugins/nx-tsconfig-paths.plugin.ts#L117) but in my case, it resolves to the tsconfig under the workspace root foder.
https://github.com/nrwl/nx/blob/master/packages/vite/plugins/nx-tsconfig-paths.plugin.ts#L117
{ "compileOnSave": false, "compilerOptions": { "rootDir": ".", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, "target": "es2015", "module": "esnext", "lib": ["es2020", "dom"], "skipLibCheck": true, "skipDefaultLibCheck": true, "baseUrl": ".", "paths": {} }, "exclude": ["node_modules", "tmp"] }
{ "compilerOptions": { "jsx": "react-jsx", "allowJs": true, "esModuleInterop": false, "allowSyntheticDefaultImports": true, "strict": true, "types": ["vite/client", "vitest"], "baseUrl": ".", "paths": { "@/*": ["./src/*"] } }, "files": [], "include": [], "references": [ { "path": "./tsconfig.app.json" }, { "path": "./tsconfig.spec.json" } ], "extends": "../../tsconfig.base.json" }
Node : 20.17.0 OS : darwin-x64 Native Target : x86_64-macos npm : 10.8.2 nx : 20.0.3 @nx/js : 20.0.3 @nx/jest : 20.0.3 @nx/eslint : 20.0.3 @nx/workspace : 20.0.3 @nx/cypress : 20.0.3 @nx/devkit : 20.0.3 @nx/eslint-plugin : 20.0.6 @nx/react : 20.0.3 @nx/vite : 20.0.3 @nx/web : 20.0.3 typescript : 5.6.3 --------------------------------------- Registered Plugins: @nx/vite/plugin @nx/eslint/plugin @nx/cypress/plugin @nx/jest/plugin ---------------------------------------
[Nx Vite TsPaths] Resolved @/contexts to undefined
No response
facing the same issue while setting up @nx/vite:test for angular.
@nx/vite:test
Current Behavior
Hello !
The
@nx/vite/plugins/nx-tsconfig-paths.plugin
path resolution is not working as expected.I think the first tsconfig is supposed to be the project tsconfig (https://github.com/nrwl/nx/blob/master/packages/vite/plugins/nx-tsconfig-paths.plugin.ts#L117) but in my case, it resolves to the tsconfig under the workspace root foder.
Expected Behavior
I think the first tsconfig is supposed to be the project tsconfig (https://github.com/nrwl/nx/blob/master/packages/vite/plugins/nx-tsconfig-paths.plugin.ts#L117) but in my case, it resolves to the tsconfig under the workspace root foder.
GitHub Repo
https://github.com/nrwl/nx/blob/master/packages/vite/plugins/nx-tsconfig-paths.plugin.ts#L117
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response