-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why are absolute ids skipped? #101
Comments
It's a perf optimization. PR welcome |
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. |
@rtmann This issue is about using tsconfig to redirect paths like |
Just ran into this issue. Even though absolute paths are generally disencouraged, there are legitimate use cases. For example, if you want to deploy code into AWS Lambda functions, but you want to keep your deployment size as minimal as possible, you can use dependency layers where you can put common code like service classes etc. These layers are then mounted into the Lambda with a prefix '/opt', creating import paths like '/opt/services/MyService', so you know in the target runtime this absolute path will be available to your code. So making absolute paths possible via config param/whatever would be a big improvement. |
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 likeimport 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.The text was updated successfully, but these errors were encountered: