Skip to content

Commit

Permalink
Merge pull request #618 from embroider-build/reuse-in-repo-addons
Browse files Browse the repository at this point in the history
allow REUSE_WORKSPACE with in repo addons
  • Loading branch information
ef4 authored Nov 18, 2020
2 parents 58736a9 + b108e17 commit 873aeca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/compat/src/prebuilt-addons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RehomedPackageCache extends PackageCache {
constructor(private appSrcDir: string, private appDestDir: string) {
super();
}
protected basedir(pkg: Package): string {
basedir(pkg: Package): string {
if (pkg.root === this.appSrcDir) {
return this.appDestDir;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/package-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class PackageCache {
protected rootCache: Map<string, Package> = new Map();
protected resolutionCache: Map<Package, Map<string, Package | null>> = new Map();

protected basedir(pkg: Package): string {
basedir(pkg: Package): string {
return pkg.root;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default class Package {
// stop you.
let pkg;
try {
pkg = this.packageCache.get(join(this.root, path));
pkg = this.packageCache.get(join(this.packageCache.basedir(this), path));
} catch (err) {
// package was missing or had invalid package.json
return false;
Expand All @@ -153,7 +153,7 @@ export default class Package {
main = `${main}.js`;
}

let mainPath = join(this.root, path, main);
let mainPath = join(this.packageCache.basedir(this), path, main);
if (!existsSync(mainPath)) {
// package has no valid main
return false;
Expand Down

0 comments on commit 873aeca

Please sign in to comment.