Skip to content

Commit

Permalink
fix(plugin): add artus dir to package path resolver for pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
noahziheng committed Jul 20, 2023
1 parent 708889b commit 23ac385
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/plugin/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ export function topologicalSort(pluginInstanceMap: Map<string, PluginType>, plug
}

// A util function of get package path for plugin
export function getPackagePath(packageName: string, paths?: string[]): string {
const opts = paths ? { paths } : undefined;
return path.resolve(require.resolve(packageName, opts), '..');
export function getPackagePath(packageName: string, paths: string[] = []): string {
const opts = {
paths: paths.concat(__dirname),
};
return path.dirname(require.resolve(packageName, opts));
}

export async function getInlinePackageEntryPath(packagePath: string): Promise<string> {
Expand Down

0 comments on commit 23ac385

Please sign in to comment.