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:
- preserve: The script is run automatically before the catalyst serve command is executed.
- postserve: The script is run automatically after the catalyst serve command is executed.
- predeploy: The script is run automatically before the catalyst deploy command is executed.
- 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.
-
All the above mentioned scripts will be executed in the source directory of the current Catalyst component.
-
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
Yes
No
Send your feedback to us