appflow.config.json allows you to specify specific behaviors for:
- App directory - in what directory should Appflow start building your app
- Dependency installation - what commands should Appflow use to install dependencies
- Web build - what commands should Appflow call to generate the web build
Appflow integrates with npm for dependency installation and to generate the web portion of the build, though for some scenarios such as monorepos, yarn, lerna, and other specific cases different integrations might be needed.
In addition, Appflow assumes that there is one app in each Git repo and that app is in the repo's root, which, especially for monorepos, may not be true.
appflow.config.json should be placed in the root of the Git repo and there should only ever be one.
The format of the config file is as such:
apps- the apps block can contain one or more app block definitions.
Each app block can contain the following elements. The only required element of the app block is
appId. Unused elements out can be left out.
appId- the id of the Application in Appflow, this can be seen on the Application overview page. This is the only required element of the app block
root- the directory that Appflow should build the Application from, all commands including
webBuildCommandare called from this location. Left unset Appflow defaults to the root of the Git repo.
dependencyInstallCommand- the command to call to install Application dependencies. It can include navigation to a different directory, if required.
npm installwill be called if it is not set.
webBuildCommand- the command to call to generate the web build for the Application. It can include navigation to a different directory, if required.
npm run build(or
npm run appflow:build, see here for details on
appflow:build) will be called if it is not set.
webBuildCommand the provided command is called as a shell command, so if needed the current directory can be changed by a command formatted like this:
A Git repo with two apps each in their own subfolder and no other requirements.
A Git repo with two apps each in their own subfolder and with Yarn used for installing dependencies.
A Git repo with two apps each in their own subfolder and with Lerna used for installing dependencies.
A Git repo with two apps in their own subfolder and with Nx used for installing dependencies and building.
We currently recommend using the nxtend Ionic community plugins for developing Ionic applications in an Nx workspace. However, these plugins are third-party and are not officially supported by Ionic.
A Git repo with a single app requiring a special web build command for two different types of builds, note each build here needs to be a different app in Appflow