Skip to content

Commit

Permalink
Merge pull request #243 from netease-lcap/lyjamare-patch-1
Browse files Browse the repository at this point in the history
Update complie.js
  • Loading branch information
lyjamare authored Sep 24, 2024
2 parents bae5383 + 700b321 commit 5259467
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions script/temp/lifecycle/complie.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ const feBuild = async (package) => {
await execCommands(['npm install --force', 'npm run build'], {
cwd,
});
await execCommand('npm run usage', {
throwWhenStderr: false,
cwd,
});

// 检查 tsconfig.json 是否存在
const tsconfigPath = path.resolve(cwd, 'tsconfig.json');
try {
await fsp.access(tsconfigPath, fs.constants.F_OK);
console.log('tsconfig.json 存在,不执行 "npm run usage" 命令。');
} catch (err) {
// 如果 tsconfig.json 不存在,则执行 "npm run usage"
await execCommand('npm run usage', {
throwWhenStderr: false,
cwd,
});
}
};

const beBuild = async ({ cwd }) => {
Expand Down

0 comments on commit 5259467

Please sign in to comment.