✨ Improve code formatting and readability in build verification script
This commit is contained in:
@@ -41,7 +41,9 @@ for (const file of REQUIRED_FILES) {
|
||||
if (exists) {
|
||||
const stats = fs.statSync(filePath);
|
||||
const isDir = stats.isDirectory();
|
||||
console.log(` ✅ ${file} ${isDir ? '(directory)' : `(${(stats.size / 1024).toFixed(2)} KB)`}`);
|
||||
console.log(
|
||||
` ✅ ${file} ${isDir ? '(directory)' : `(${(stats.size / 1024).toFixed(2)} KB)`}`
|
||||
);
|
||||
} else {
|
||||
errors.push(`Required file missing: ${file}`);
|
||||
console.log(` ❌ ${file} - MISSING`);
|
||||
@@ -67,14 +69,18 @@ if (fs.existsSync(assetsDir)) {
|
||||
const stats = fs.statSync(path.join(assetsDir, file));
|
||||
return total + stats.size;
|
||||
}, 0);
|
||||
console.log(` Total JS size: ${(totalJsSize / 1024 / 1024).toFixed(2)} MB`);
|
||||
console.log(
|
||||
` Total JS size: ${(totalJsSize / 1024 / 1024).toFixed(2)} MB`
|
||||
);
|
||||
|
||||
// Warn if bundles are too large
|
||||
jsFiles.forEach(file => {
|
||||
const stats = fs.statSync(path.join(assetsDir, file));
|
||||
const sizeMB = stats.size / 1024 / 1024;
|
||||
if (sizeMB > 1) {
|
||||
warnings.push(`Large bundle detected: ${file} (${sizeMB.toFixed(2)} MB)`);
|
||||
warnings.push(
|
||||
`Large bundle detected: ${file} (${sizeMB.toFixed(2)} MB)`
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user