Joe Beuckman
Joe Beuckman

Reputation: 2296

Package Cordova Hook with a Plugin?

I would like to package a bit of before_build logic as a hook with my plugin. Is it possible and if so, how?

Upvotes: 0

Views: 60

Answers (1)

Joe Beuckman
Joe Beuckman

Reputation: 2296

Yes. From http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html

As a plugin developer you can define hook scripts using elements in a plugin.xml like that:

<hook type="before_plugin_install" src="scripts/beforeInstall.js" />
<hook type="after_build" src="scripts/afterBuild.js" />

<platform name="wp8">
    <hook type="before_plugin_install" src="scripts/wp8BeforeInstall.js" />
    <hook type="before_build" src="scripts/wp8BeforeBuild.js" />
    ...
</platform>

Upvotes: 1

Related Questions