mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-08 06:17:06 +00:00
chore(ci): increase bundle size limit to 1mb for react dashboard
This commit is contained in:
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user