Open brillout opened 8 months ago
A correct implement isn't trivial, see https://github.com/rolldown/rolldown/issues/637.
Instead, Vike could support this if and only if tsconfig.json#compilerOptions.paths
/package.json#imports
lives in the same directory than vite.config.js
.
It's on Vite's radar: https://twitter.com/youyuxi/status/1770453125067149448.
Description
Instead of having to define path aliases up to two times (as described in https://vike.dev/path-aliases), it would be nice if users can define their path aliases only once.
JavaScript users would define aliases only once at their
package.json#imports
.TypeScript users would define aliases only once at
tsconfig.json#compilerOptions.paths
.We can then show a warning/error if the user attemps to define a path alias using
vite.config.js
. (I believe if Vike uses aconfig()
hook instead ofconfigResolved()
it can apply the warning/error only to path aliases set by the user, and not to path aliases set by Vite plugins.)