File tree Expand file tree Collapse file tree
packages/vite/src/node/plugins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -485,11 +485,14 @@ function tryFsResolve(
485485) : string | undefined {
486486 const { file, postfix } = splitFileAndPostfix ( fsPath )
487487
488+ // Dependencies like es5-ext use `#` in their paths. We don't support `#` in user
489+ // source code so we only need to perform the check for dependencies.
490+ const tryUnsplitted = fsPath . includes ( '#' ) && fsPath . includes ( 'node_modules' )
491+
488492 let res : string | undefined
489493
490- // if there is a postfix, try resolving it as a complete path first (#4703)
491494 if (
492- postfix &&
495+ tryUnsplitted &&
493496 ( res = tryResolveFile (
494497 fsPath ,
495498 '' ,
@@ -519,7 +522,7 @@ function tryFsResolve(
519522
520523 for ( const ext of options . extensions ) {
521524 if (
522- postfix &&
525+ tryUnsplitted &&
523526 ( res = tryResolveFile (
524527 fsPath + ext ,
525528 '' ,
@@ -554,7 +557,7 @@ function tryFsResolve(
554557 if ( ! tryIndex ) return
555558
556559 if (
557- postfix &&
560+ tryUnsplitted &&
558561 ( res = tryResolveFile (
559562 fsPath ,
560563 '' ,
You can’t perform that action at this time.
0 commit comments