Add nodemon, nodemon.json and update dev script

Add a nodemon.json config to watch src and public (ext: astro, ts, html), add nodemon as a devDependency, and change the package.json "dev" script to run nodemon --config nodemon.json --exec 'astro build' (replacing the previous "astro dev"). Also remove the preview script.
This commit is contained in:
Ryan Wang
2026-04-09 14:42:08 +08:00
parent 6f1cede536
commit e85fbd62f4
3 changed files with 191 additions and 8 deletions
+2 -2
View File
@@ -4,9 +4,8 @@
"node": ">=22.12.0"
},
"scripts": {
"dev": "astro dev",
"dev": "nodemon --config nodemon.json --exec 'astro build'",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"format": "prettier --write ."
},
@@ -35,6 +34,7 @@
},
"devDependencies": {
"@iconify-json/mingcute": "^1.2.7",
"nodemon": "^3.1.14",
"prettier": "3.8.1",
"prettier-plugin-astro": "0.14.1",
"unplugin-icons": "^23.0.1"