Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 committed May 6, 2024
1 parent 302b8d9 commit 1e05a28
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/ci-mock-project-build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const os = require('os');
const assert = require('assert');
const { execa, prompts, yParser, fsExtra } = require('@umijs/utils');

Expand Down Expand Up @@ -46,8 +47,10 @@ function main() {

const projectName = `dumi-${finalType}`;
const tmpDir = path.join(
process.cwd(),
`.tmp/mock-${projectName}/${finalClient}`,
os.tmpdir(),
'create-dumi',
`mock-${projectName}`,
finalClient,
);
fsExtra.emptyDirSync(tmpDir);

Expand Down Expand Up @@ -104,10 +107,14 @@ function main() {
fsExtra.existsSync(distDir),
`expect dist directory ${distDir} exists`,
);
console.log(`✅ [${finalType}] build successfully`);

const distDirSize = getTotalSize(distDir);
assert(
getTotalSize(distDir) > 10 * 1024,
distDirSize > 10 * 1024,
`expect dist directory ${distDir} not empty`,
);
console.log(`📦 [${finalType}] dist size: ${distDirSize} bytes`);
});
}

Expand Down

0 comments on commit 1e05a28

Please sign in to comment.