Skip to content
PirefactorCLI & tooling4 files · +35 −40

Clean up Vite/tsconfig configs across pi-web monorepo packages

Session from pi-web on Hugging Face by woxQAQ · MIT · condensed by Coders Talk

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.

  1. Prompt · +0
    Why does packages/bin/vite.config.ts have an alias for @pi-web/bridge?
  2. Agent did · +0m
    Investigated bridge package.json exports and confirmed the alias bypasses pnpm symlink + exports resolution; concluded it's redundant but recommended keeping it for safety
  3. Prompt · +4m
    Remove the alias, and make the config more idiomatic monorepo style
  4. Fail · +5m
    After removing the alias and the now-unused resolve import, pnpm run build:bin failed because resolve was still needed for the entry path
  5. Agent did · +5m
    Restored 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
  6. Agent did · +9m
    Noticed ssr: true had been dropped from vite.config.ts during the earlier alias edit and restored it, then confirmed build:bin still passes
  7. Prompt · +14m
    Why is ssr turned on in vite.config.ts? ... Remove it
  8. Agent did · +15m
    Removed 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
  9. Outcome · +22m
    bin 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.

I tried this · 0

Discussion · 0

How Builds work