Christian
Christian

Reputation: 4104

Cordova CLI Lifecycle - Hooks Order

In which order are the hooks in cordova executed?

I can't find a reliable source for the order of hooks. All I've found was a alphabetical list of hooks: https://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html

Upvotes: 1

Views: 418

Answers (1)

Sithys
Sithys

Reputation: 3803

There is already a part inside the documentation (nearly at the top) which tells you in which order the hooks are executed:

Hook scripts could be defined by adding them to the special predefined folder (/hooks) or via configuration files (config.xml and plugin.xml) and run serially in the following order:

Application hooks from /hooks; Application hooks from config.xml; Plugin hooks from plugins/.../plugin.xml. Note: /hooks directory is considered deprecated in favor of the hook elements in config.xml and plugin.xml.

The single hooks inside your config.xml will of course be executed from the top to the bottom of your document. :)

Upvotes: 2

Related Questions