chore: bump version to 4.0.16 and clean up source maps in build output

- 版本号 4.0.15 → 4.0.16 (package.json + MACRO.VERSION)
- build.ts: 新增 Step 6,构建完成后清理 .map 文件(约 64MB)
  解决 npm mirror 80MB 包体积限制的同步失败问题
This commit is contained in:
y574444354 2026-05-12 15:22:34 +08:00
parent 73f8641033
commit 79548c324e
3 changed files with 15 additions and 2 deletions

View File

@ -136,3 +136,16 @@ chmodSync(cliBun, 0o755)
chmodSync(cliNode, 0o755)
console.log(`Generated ${cliBun} (shebang: bun) and ${cliNode} (shebang: node)`)
// Step 6: Clean up source maps — they add ~64MB to the package, exceeding
// npmmirror's 80MB size limit. Source maps are only useful for local
// debugging, not for package consumers.
const { unlinkSync } = await import('fs')
let mapCount = 0
for (const file of files) {
if (file.endsWith('.map')) {
unlinkSync(join(outdir, file))
mapCount++
}
}
console.log(`Cleaned ${mapCount} source map files from ${outdir}/ (saved ~64MB)`)

View File

@ -1,6 +1,6 @@
{
"name": "@costrict/csc",
"version": "4.0.15",
"version": "4.0.16",
"description": "costrict",
"type": "module",
"author": "costrict",

View File

@ -14,7 +14,7 @@ export function getMacroDefines(): Record<string, string> {
// ignore git errors
}
return {
"MACRO.VERSION": JSON.stringify("4.0.15"),
"MACRO.VERSION": JSON.stringify("4.0.16"),
"MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()),
"MACRO.COMMIT": JSON.stringify(commit),
"MACRO.FEEDBACK_CHANNEL": JSON.stringify(""),