Skip to content

Commit 609d702

Browse files
chore(release): clean dist/ before tsc to prevent stale artifacts
tsc does not remove output files when their source is deleted or renamed, so successive refactors leave bit-rotted files in dist/. The 2.0.0 tarball still shipped dist/schema.js (pre-split monolith), dist/tools/domains.js, dist/tools/account.js, and dist/tools/generate- domains.js -- all dead weight that no live code imports. Add a portable clean step (node -e fs.rmSync) and run it from a prebuild hook so every build starts from an empty dist/. No new dependency. Impact on the 2.0.0 tarball: - files: 112 -> 100 - packed size: 54.4 KB -> 42.8 KB - unpacked: 289.1 KB -> 194.7 KB - brotli size: 25.65 KB -> 18.53 KB (size-limit) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2aad26e commit 609d702

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
},
3131
"scripts": {
3232
"start": "tsx src/index.ts",
33+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
34+
"prebuild": "npm run clean",
3335
"build": "tsc",
3436
"dev": "tsx watch src/index.ts",
3537
"test": "vitest run",

0 commit comments

Comments
 (0)