We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bae5383 commit 700b321Copy full SHA for 700b321
script/temp/lifecycle/complie.js
@@ -25,10 +25,19 @@ const feBuild = async (package) => {
25
await execCommands(['npm install --force', 'npm run build'], {
26
cwd,
27
});
28
- await execCommand('npm run usage', {
29
- throwWhenStderr: false,
30
- cwd,
31
- });
+
+ // 检查 tsconfig.json 是否存在
+ const tsconfigPath = path.resolve(cwd, 'tsconfig.json');
+ try {
32
+ await fsp.access(tsconfigPath, fs.constants.F_OK);
33
+ console.log('tsconfig.json 存在,不执行 "npm run usage" 命令。');
34
+ } catch (err) {
35
+ // 如果 tsconfig.json 不存在,则执行 "npm run usage"
36
+ await execCommand('npm run usage', {
37
+ throwWhenStderr: false,
38
+ cwd,
39
+ });
40
+ }
41
};
42
43
const beBuild = async ({ cwd }) => {
0 commit comments