aleclarson / vite-tsconfig-paths

Support for TypeScript's path mapping in Vite
MIT License
1.23k stars 44 forks source link

Why are absolute ids skipped? #101

Open eddiemonge opened 1 year ago

eddiemonge commented 1 year ago

On this line https://github.com/aleclarson/vite-tsconfig-paths/blob/master/src/index.ts#L114, it skips it if it is an "absolute path" but why?

I have this in my tsconfig: "paths": { "/*": ["./*"] }," so I can do imports like import CardNavItem from '/UI/CardNavItem';. This fails through the plugin but if I remove the isAbsolute check it works and in my limited testing, doesn't seem to break anything else.

aleclarson commented 1 year ago

It's a perf optimization. PR welcome

rtmann commented 8 months ago

Perf optimization? So is this saying that vite-tsconfig-paths does not support absolute alias's like "@common/models" ????

If so, I've wasted days debugging my build and this was the problem the whole time.

aleclarson commented 8 months ago

@rtmann This issue is about using tsconfig to redirect paths like /x/y/z (note the leading slash)