diff --git a/.gitignore b/.gitignore index 63c5d36..b348f44 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,9 @@ pnpm-debug.log* # macOS-specific files .DS_Store +# dev server pid +.dev.pid + # jetbrains setting folder .idea/ .pnpm-store diff --git a/package.json b/package.json index ccbc09e..ac206a0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "version": "0.0.1", "scripts": { - "dev": "astro dev", + "dev": "[ -f .dev.pid ] && kill -0 $(cat .dev.pid) 2>/dev/null && echo '开发服务器已在运行 (PID: '$(cat .dev.pid)')' || (astro dev & echo $! > .dev.pid)", "build": "astro build", "preview": "astro preview", "astro": "astro"