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.