Skip to content

Commit

Permalink
always use rewritten paths in canResolveFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 authored and mansona committed Nov 21, 2023
1 parent 9ec4174 commit 1389d87
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/compat/src/compat-app-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,16 @@ export class CompatAppBuilder {
if (!child.isEngine()) {
this.findActiveAddons(child, engine, true);
}
engine.addons.set(child, resolvePath(pkg.root, 'package.json'));
let canResolveFrom: string;
if (pkg === this.appPackageWithMovedDeps) {
// we want canResolveFrom to always be a rewritten package path, and our
// app's package is not rewritten yet here.
canResolveFrom = resolvePath(this.root, 'package.json');
} else {
// whereas our addons are already moved
canResolveFrom = resolvePath(pkg.root, 'package.json');
}
engine.addons.set(child, canResolveFrom);
}
// ensure addons are applied in the correct order, if set (via @embroider/compat/v1-addon)
if (!isChild) {
Expand Down

0 comments on commit 1389d87

Please sign in to comment.