diff --git a/packages/vite/src/node/optimizer/esbuildDepPlugin.ts b/packages/vite/src/node/optimizer/esbuildDepPlugin.ts index c4468e1465062e..71d8ed81c70c61 100644 --- a/packages/vite/src/node/optimizer/esbuildDepPlugin.ts +++ b/packages/vite/src/node/optimizer/esbuildDepPlugin.ts @@ -91,7 +91,7 @@ export function esbuildDepPlugin( namespace: 'dep' } : { - path: require.resolve(flatId, { + path: require.resolve(qualified[flatId], { paths: [resolveDir] }) }