Skip to content

Commit

Permalink
fix(plugin): add artus dir to package path resolver for pnpm (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahziheng authored Jul 25, 2023
1 parent fc3504d commit f5ab0e2
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 f5ab0e2

Please sign in to comment.