allow use @ as aliases prefix #1134
Replies: 5 comments 11 replies
-
I see, let me have a look. (I agree Vike should support Nx. And it should, ideally, support it seamlessly.) |
Beta Was this translation helpful? Give feedback.
-
Can you create a reproduction for this? |
Beta Was this translation helpful? Give feedback.
-
Interesting. I'm using NX and I didn't run across this issue although I did struggle with having Vike reconcile multiple packages. Couple of things that you're doing differently. 1. My monorepo doesn't have @ in the paths, but it does in the organization prefix of package.json names. 2. I didn't point the vite root to the monorepo root. I ended up putting my frontend code in the same package as the fastify server. This was okay for my situation because all it does is render, business logic is taken care of by other microservices. |
Beta Was this translation helpful? Give feedback.
-
@DreamwareDevelopment It looks like you're not using the official Nx Vite+React generator. The configuration snippet |
Beta Was this translation helpful? Give feedback.
-
Looks like the problem is gone when nx switched to nxViteTsPaths instead of viteTsConfigPaths? |
Beta Was this translation helpful? Give feedback.
-
nx is a widely used monorepo tool, and all the internal libraries managed with it start with "@" as a prefix, and this prefix cannot be modified. my packages will never publishes to npm.
nx don't use aliases, it defines package names by setting
compilerOptions.paths
to tsconfig.json, and use viteTsConfigPaths plugin to resolve these names.however, vike is not compatible with
viteTsConfigPaths
plugin, so the workaround is using aliases, otherwise vite will build faild.If Vike is not compatible with "@" symbol, it will result in losing all the developers who rely on nx.
Beta Was this translation helpful? Give feedback.
All reactions