aleclarson / vite-tsconfig-paths

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

What happens when alias is identical to node_modules package name? #112

Open caldwell-63 opened 1 year ago

caldwell-63 commented 1 year ago

what happens if I do

// src/index.js
import something from 'shared';

assuming that my baseUrl is set to src, it can be either:

which one takes precedence? Is there a way to explicitly specify package import or bare import? (without falling back to relative paths)

the possibility of such conflicts and no obvious way to resolve them is i think the main reason bare imports are not supported by default by vite or other bundlers, so if this plugin attempts to address this, i think it's worth documenting the approach taken

aleclarson commented 3 days ago

We should match whatever TypeScript does. Let me know what you find.