Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Sep 5, 2024
1 parent f8dadae commit 70756d7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/vite/src/esbuild-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ export function esBuildResolver(extensions: string[]): EsBuildPlugin {
let pkgCache = resolverLoader.resolver.packageCache;
let fromPkg = pkgCache.ownerOfFile(request.fromFile);
let toPkg = pkgCache.ownerOfFile(resolution.result.path!);
let fromAppFile = fromPkg?.isV2App() || fromPkg && resolverLoader.resolver.reverseSearchAppTree(fromPkg, request.fromFile);
let toAppFile = toPkg?.isV2App() || toPkg && resolverLoader.resolver.reverseSearchAppTree(toPkg, resolution.result.path!);
let fromAppFile =
fromPkg?.isV2App() ||
(fromPkg && resolverLoader.resolver.reverseSearchAppTree(fromPkg, request.fromFile));
let toAppFile =
toPkg?.isV2App() ||
(toPkg && resolverLoader.resolver.reverseSearchAppTree(toPkg, resolution.result.path!));
if (toAppFile) {
if (!fromAppFile) {
let encoded = resolverLoader.resolver.generateEncodedRequest(request);
Expand Down

0 comments on commit 70756d7

Please sign in to comment.