firebase deploy: how to modify pre-deploy

There is documentation for predeploy hooks with the Firebase CLI.

For any of the assets you can deploy—hosting, functions, database, storage, and firestore— you can add predeploy and postdeploy hooks in firebase.json, and your scripts will run with the corresponding deployment command. Both predeploy and postdeploy hooks print the standard output and error streams of the scripts to the terminal.

For example:

 {
   "hosting":{
     "postdeploy":"./messageSlack.sh 'Just deployed to Firebase Hosting'",
     "public":"public"
   }
 }

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

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