Skip to content

Commit

Permalink
fix(cli): entry生成路径错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinyzheng authored and roymondchen committed Nov 14, 2022
1 parent 04e1857 commit f5a8d6b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/cli/src/utils/resolveAppPackages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,11 @@ const getASTTokenByTraverse = ({ ast, indexPath }: { ast: any; indexPath: string
});

Object.keys(exportSpecifiersMap).forEach((exportName) => {
const filePath = path.resolve(
path.dirname(indexPath),
exportSpecifiersMap[exportName] || importSpecifiersMap[exportName] || '',
);
const exportValue = exportSpecifiersMap[exportName];
const importValue = importSpecifiersMap[exportName];
const connectValue = exportValue ? importSpecifiersMap[exportValue] : '';
const filePath = path.resolve(path.dirname(indexPath), connectValue || importValue || exportValue || '');

if (exportName === EntryType.VALUE) {
value = filePath;
} else if (exportName === EntryType.CONFIG) {
Expand Down

0 comments on commit f5a8d6b

Please sign in to comment.