build: make npm run build self-sufficient

The ts-cleaner step in the build script scans dist/ and crashes with
ENOENT if the directory doesn't exist (e.g. on a fresh clone or after
git clean). Previously README told users to 'mkdir -p dist' first,
but Dockerfile and CI didn't necessarily follow that. Prepend a small
node one-liner that mkdir's dist recursively before ts-cleaner runs,
and drop the now-redundant manual step from README.
This commit is contained in:
Claude Owner
2026-05-26 14:48:30 +09:00
parent 499852b2a7
commit 204b813ecc
2 changed files with 2 additions and 3 deletions

View File

@@ -15,7 +15,7 @@
"type": "commonjs",
"main": "dist/index.js",
"scripts": {
"build": "ts-cleaner && tsc",
"build": "node -e \"require('fs').mkdirSync('dist',{recursive:true})\" && ts-cleaner && tsc",
"start": "node .",
"dev": "ts-node src/index.ts",
"prod": "ts-node src/utils/Prod-commands.ts",