aleclarson / vite-tsconfig-paths

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

bare module - node module import conflict resolving #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