Skip to content

Commit

Permalink
updata
Browse files Browse the repository at this point in the history
  • Loading branch information
Null committed Sep 19, 2024
1 parent c569a4f commit e6073d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/build-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const indexFile = join(packagesDir, 'index.ts');
// ast 方式 注入 import 以及 export
export const buildImportExport = async (dir, packageName) => {
// eslint-disable-next-line no-async-promise-executor
new Promise(async (resolve) => {
return new Promise(async (resolve) => {
const code = fs.readFileSync(indexFile, 'utf-8');

// 解析成 AST
Expand Down Expand Up @@ -113,7 +113,7 @@ export const buildImportExport = async (dir, packageName) => {
formattedCode = await format(formattedCode, { parser: 'babel', ...options });

// 写回 index.js 文件
fs.writeFileSync(indexFile, formattedCode);
await fs.writeFile(indexFile, formattedCode);

resolve(true);
});
Expand Down

0 comments on commit e6073d0

Please sign in to comment.