Lifecycle and Custom Scripts

Before you learn about writing a script, let’s discuss the two types of scripts supported in Catalyst.

Catalyst supports the following lifecycle scripts:

  1. preserve: The script is run automatically before the catalyst serve command is executed.
  2. postserve: The script is run automatically after the catalyst serve command is executed.
  3. predeploy: The script is run automatically before the catalyst deploy command is executed.
  4. postdeploy: The script is run automatically after the catalyst deploy command is executed.

You can set custom scripts to automatically execute any time you need them to, in the order that you need, by calling them inside the lifecycle scripts.

Note:
  1. All the above mentioned scripts will be executed in the source directory of the current Catalyst component.

  2. You can choose to skip the executions of the lifecycle scripts configured in the catalyst.json file while testing or deploying the components. To do so, you must execute the catalyst serve or catalyst deploy with the –ignore-scripts option. Refer to their respective help pages for details.

Last Updated 2023-12-14 16:25:23 +0530 +0530

ON THIS PAGE