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:
@@ -85,8 +85,7 @@ npm install
|
|||||||
# 개발 (ts-node)
|
# 개발 (ts-node)
|
||||||
npm run dev
|
npm run dev
|
||||||
|
|
||||||
# 빌드 후 실행 (ts-cleaner가 dist/를 스캔하므로 먼저 만들어야 함)
|
# 빌드 후 실행 (build 스크립트가 dist 디렉터리를 자동 생성)
|
||||||
mkdir -p dist
|
|
||||||
npm run build
|
npm run build
|
||||||
npm start
|
npm start
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ts-cleaner && tsc",
|
"build": "node -e \"require('fs').mkdirSync('dist',{recursive:true})\" && ts-cleaner && tsc",
|
||||||
"start": "node .",
|
"start": "node .",
|
||||||
"dev": "ts-node src/index.ts",
|
"dev": "ts-node src/index.ts",
|
||||||
"prod": "ts-node src/utils/Prod-commands.ts",
|
"prod": "ts-node src/utils/Prod-commands.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user