Files
David Luzar 4eb1e648aa ci(repo): track bundle size and performance of master builds (#12469)
- `Stats` workflow on master: posts the production build's file sizes (raw, gzip, Brotli; initial load vs. lazy; bytes per source package) and, once staging serves the commit, its page-load and pan/zoom measurements to the Excalidraw+ backend; OSS_STATS_TOKEN lives in the master-only `stats` environment
- `scripts/stats/`: bundle-stats Vite plugin and wrapper config (`yarn stats:bundle`), the Playwright runner (`yarn stats:perf`) and the poster
- `yarn stats:compare`: builds the checkout, serves it with `vite preview` and compares it with staging (alternating loads, Mann-Whitney U test); prints a table or writes CSV with `--out`
- `excalidraw:app-start` mark in the app's entry, ending the runs' "HTML + JS" phase
- `playwright` 1.58.2 dev dependency (installs no browsers by itself)

Claude Opus 5.5 (xhigh)
2026-10-27 15:34:46 +01:00

18 lines
624 B
TypeScript

import { defineConfig, mergeConfig } from "vite";
import appConfig from "../../excalidraw-app/vite.config.mts";
import { bundleStatsPlugin } from "./bundle-stats-plugin.mts";
/**
* The app's production build plus `bundle-stats.json` (`yarn stats:bundle`,
* run from `excalidraw-app/` like the app's own build). The stats aren't part
* of the deployed builds, so they only cost CI the extra compression.
*/
export default defineConfig(async (env) => {
const config =
typeof appConfig === "function" ? await appConfig(env) : await appConfig;
return mergeConfig(config, { plugins: [bundleStatsPlugin()] });
});