File tree 1 file changed +7
-4
lines changed
packages/vite/src/node/plugins
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -485,11 +485,14 @@ function tryFsResolve(
485
485
) : string | undefined {
486
486
const { file, postfix } = splitFileAndPostfix ( fsPath )
487
487
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
+
488
492
let res : string | undefined
489
493
490
- // if there is a postfix, try resolving it as a complete path first (#4703)
491
494
if (
492
- postfix &&
495
+ tryUnsplitted &&
493
496
( res = tryResolveFile (
494
497
fsPath ,
495
498
'' ,
@@ -519,7 +522,7 @@ function tryFsResolve(
519
522
520
523
for ( const ext of options . extensions ) {
521
524
if (
522
- postfix &&
525
+ tryUnsplitted &&
523
526
( res = tryResolveFile (
524
527
fsPath + ext ,
525
528
'' ,
@@ -554,7 +557,7 @@ function tryFsResolve(
554
557
if ( ! tryIndex ) return
555
558
556
559
if (
557
- postfix &&
560
+ tryUnsplitted &&
558
561
( res = tryResolveFile (
559
562
fsPath ,
560
563
'' ,
You can’t perform that action at this time.
0 commit comments