I have a NX/vite based monorepo and want to use path alias to avoid long relative imports.
I configured my tsconfig.json for each packages and then installed the vite plugin tsconfigPaths() for reading paths from tsconfig.json.
{
"compilerOptions": {
...
"baseUrl": "./src",
"paths": {
"@components/*": ["components/*"],
"@constants/*": ["constants/*"],
"@pages/*": ["pages/*"]
}
},
...
}
Screenshot on the configuraton of nxViteTsPaths and tsconfigPaths plugins
On Nx's official document for configuring vite /recipes/vite/configure-vite, they required to use nxViteTsPaths() plugin, but I failed to find enough doc or source code from /plugin-registry.
Could anyone share insights on what additional functionality this nxViteTsPaths() does?