chore(ci): increase bundle size limit to 1mb for react dashboard

This commit is contained in:
kaitranntt
2025-12-07 22:54:28 -05:00
parent befecf9fb1
commit f6d6d03f01
+4 -3
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env node
/**
* Verify UI bundle size is under 500KB gzipped
* Verify UI bundle size is under 1MB gzipped
* React + shadcn/ui dashboard typically ranges 600-900KB
*/
const fs = require('fs');
@@ -9,7 +10,7 @@ const path = require('path');
const zlib = require('zlib');
const UI_DIR = path.join(__dirname, '../dist/ui');
const MAX_SIZE = 500 * 1024; // 500KB
const MAX_SIZE = 1024 * 1024; // 1MB
function getGzipSize(filePath) {
const content = fs.readFileSync(filePath);
@@ -41,7 +42,7 @@ const totalSize = walkDir(UI_DIR);
const sizeKB = (totalSize / 1024).toFixed(1);
if (totalSize > MAX_SIZE) {
console.log(`[X] Bundle too large: ${sizeKB}KB gzipped (max: 500KB)`);
console.log(`[X] Bundle too large: ${sizeKB}KB gzipped (max: 1024KB)`);
process.exit(1);
} else {
console.log(`[OK] Bundle size: ${sizeKB}KB gzipped`);