Basic Scripts

{
  "scripts": {
    "dev": "astro dev",
    "build": "astro build",
    "preview": "astro preview",
    "lint": "eslint src/",
    "deploy": "npm run build && wrangler deploy"
  }
}
npm run dev
npm run build

Special Script Names

Script nameHow to run
startnpm start (no run needed)
testnpm test (no run needed)
prebuildRuns automatically before build

Common Pitfalls

  • && may not work on Windows — use cross-env or separate scripts
  • npm start and npm test don’t need the run keyword

To run these scripts automatically in CI, combine with GitHub Actions: Basic Auto-Deploy Setup.

  • Fiverr - Find freelance developers and tech experts