Clean up Vite/tsconfig configs across pi-web monorepo packages
Session from pi-web on Hugging Face by woxQAQ · MIT · condensed by Coders Talk
Click a segment to jump to that moment
22msession
0interventions
GOAL
Audit and simplify vite.config.ts and tsconfig.json across the bin, bridge and svelte packages in a pnpm monorepo, removing redundant config and aligning conventions between packages.
- +0Prompt · +0Why does packages/bin/vite.config.ts have an alias for @pi-web/bridge?
- +0mAgent did · +0mInvestigated bridge package.json exports and confirmed the alias bypasses pnpm symlink + exports resolution; concluded it's redundant but recommended keeping it for safety
- +4mPrompt · +4mRemove the alias, and make the config more idiomatic monorepo style
- +5mFail · +5mAfter removing the alias and the now-unused resolve import, pnpm run build:bin failed because resolve was still needed for the entry path
- +5mAgent did · +5mRestored the resolve import, confirmed build:bin passes, then aligned packages/bin/tsconfig.json with packages/bridge's rootDir/include/exclude pattern and verified with check:type and build:bin
- +9mAgent did · +9mNoticed ssr: true had been dropped from vite.config.ts during the earlier alias edit and restored it, then confirmed build:bin still passes
- +14mPrompt · +14mWhy is ssr turned on in vite.config.ts? ... Remove it
- +15mAgent did · +15mRemoved ssr flag (bundle shrank from 157KB to 110KB), then audited bridge's tsconfig.build.json and tsconfig.json fixing a redundant exclude and a too-broad include, confirmed exports are still needed for subpath imports, and finally reviewed the svelte package's vite.config.ts, package.json, tsconfig.json and svelte.config.js
- +22mOutcome · +22mbin and bridge vite/tsconfig configs cleaned and aligned; type check and build:bin/build:bridge pass; bin bundle reduced 157KB→110KB after removing ssr; svelte package review flagged dead commented-out migration code and a missing rootDir, left unresolved at session end
VERDICT
Next time I'd start by asking the agent to scan all package configs at once instead of going file by file, since the bin/bridge/svelte tsconfigs and vite configs kept drifting out of sync with each other. The one correction that actually mattered was catching that ssr:true and the resolve import got silently dropped during an earlier edit — rebuilding after each change is what caught that before it shipped.