CLI Hooks
A collection of useful hook scripts for Ionic apps.
Install
$ npm i @ionic/cli-hooks
Use
Modify your ionic.config.json
file to add a hooks
object:
"hooks": {
"<hook>": [
"node_modules/@ionic/cli-hooks/<file>.js"
]
}
Replace <hook>
with the name of the hook you want to use and <file>
with
the file name within this package.
See CLI Hook documentation for details.
List
-
node_modules/@ionic/cli-hooks/add-cordova-engine.js
: Before a build, insertcordova.js
script tag into yourindex.html
file if it does not already exist. -
node_modules/@ionic/cli-hooks/remove-cordova-engine.js
: After a build, restore the originalindex.html
file.