Skip to content

Commit c7cb75a

Browse files
committed
fix: 移除冗余的 readJson 函数,直接在 getManifestList 中读取 JSON 文件
1 parent b7c95ea commit c7cb75a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

packages/core/src/manifest-json.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ export interface ManifestJsonChunkSizes {
9696
resource: number;
9797
}
9898

99-
/**
100-
* 异步的读取一个 JSON 文件。
101-
*/
102-
async function readJson(filename: string): Promise<any> {
103-
return JSON.parse(await fsp.readFile(filename, 'utf-8'));
104-
}
105-
10699
/**
107100
* 获取服务清单文件
108101
*/
@@ -114,7 +107,7 @@ export async function getManifestList(
114107
Object.values(moduleConfig.links).map(async (item) => {
115108
const filename = path.resolve(item[target], 'manifest.json');
116109
try {
117-
const data: ManifestJson = await readJson(filename);
110+
const data: ManifestJson = await JSON.parse(await fsp.readFile(filename, 'utf-8'));
118111
data.name = item.name;
119112
return data;
120113
} catch (e) {

0 commit comments

Comments
 (0)