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:
parent
73f8641033
commit
79548c324e
13
build.ts
13
build.ts
|
|
@ -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)`)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@costrict/csc",
|
||||
"version": "4.0.15",
|
||||
"version": "4.0.16",
|
||||
"description": "costrict",
|
||||
"type": "module",
|
||||
"author": "costrict",
|
||||
|
|
|
|||
|
|
@ -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(""),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user