Search code examples
javascriptfirebasefirebase-hostingfirebase-cli

firebase deploy: how to modify pre-deploy


I have a small front-end project with javascript running on firebase hosting and I have to call the build script manually before every time I run firebase deploy. So I was looking for a way to put it in a pre-deploy script but there's no such thing in firebase CLI documentation. So anyone has any idea how to make it done?


Solution

  • Predeploy supports in latest Firebase CLI, please update your CLI and create predeploy in firebase.json file.

    "hosting": {
      "predeploy": "npm run build",
      "public": "build",