summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.husky/pre-commit7
-rw-r--r--package.json1
2 files changed, 3 insertions, 5 deletions
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 9e83e3d..e53e703 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -2,8 +2,5 @@
. "$(dirname "$0")/_/husky.sh"
npx lint-staged \
- && cd api \
- && fd "(.js|.js.map)$" | xargs rm \
- && cd ../api-src \
- && npx tsc \
- && git add ../api
+ && npm run build-api \
+ && git add api
diff --git a/package.json b/package.json
index 3cfb976..57e5bf0 100644
--- a/package.json
+++ b/package.json
@@ -8,6 +8,7 @@
"start": "astro dev",
"build": "npm run build-api && astro build",
"build-api": "cd api-src && npx tsc",
+ "prebuild-api": "cd api && fd \"(.js|.js.map)$\" | xargs rm",
"preview": "astro preview",
"astro": "astro",
"lint": "eslint .",