[Bug report] importing dependencies by fs paths results in two different copies of the same module #2503
Closed
3 tasks done
Labels
p4-important
Violate documented behavior or significantly improves performance (priority)
Describe the bug
Importing dependencies in
node_modules
by fs paths will cause unexpected behavior, because we only do version hash injection for bare imports:vite/packages/vite/src/node/plugins/resolve.ts
Lines 371 to 374 in 26c46b9
Reproduction
Reproduce repo: https://github.com/meteorlxy/repro-vite-2503
foo
module:bar
module that depends onfoo
module:foo
andbar
via fs paths:Explanation
index.js
because there is no bare import.node_modules/bar/index.js
, because it uses bare import forfoo
module.System Info
vite
version: 2.0.5The text was updated successfully, but these errors were encountered: