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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user