Skip to content

App Configuration

The Capawesome Cloud build system allows you to define your app configuration in a capawesome.config.json file. This file specifies various settings for your app builds, including build commands, dependencies, and other options.

Configuration File

The capawesome.config.json file should be placed in the root directory of your project. Below is an example configuration file:

{
    "cloud": {
        "apps": [
            {
                "appId": "4e837195-e8d8-4ad1-8705-7a32e18a98cf",
                "baseDir": "apps/capacitor-sample-app",
                "dependencyInstallCommand": "npm install",
                "webBuildCommand": "npm run build"
            }
        ]
    }
}

The following configuration options are available:

  • cloud.apps: An array of app configurations.
  • appId: The Capawesome Cloud App ID which can be found in the App Settings in Capawesome Cloud. This is required.
  • baseDir: The base directory of your app within the repository. Default is the root directory.
  • dependencyInstallCommand: The command to install dependencies for your app. Default is npm install.
  • webBuildCommand: The command to build the web assets for your app. Default is npm run build.

Examples

Subdirectory App

This example shows how to configure multiple apps located in subdirectories:

├─ apps/
│  ├─ my-app1/
│  └─ my-app2/
└─ capawesome.config.json

The corresponding capawesome.config.json would look like this:

{
    "cloud": {
        "apps": [
            {
                "appId": "your-app-id-1",
                "baseDir": "apps/my-app1"
            },
            {
                "appId": "your-app-id-2",
                "baseDir": "apps/my-app2"
            }
        ]
    }
}

Monorepo

For monorepos, you can specify the baseDir for each app accordingly:

{
    "cloud": {
        "apps": [
            {
                "appId": "your-app-id-1",
                "baseDir": "packages/app1",
                "dependencyInstallCommand": "cd ../.. && npm install",
                "webBuildCommand": "cd ../.. && npm run build --workspace=app1"
            },
            {
                "appId": "your-app-id-2",
                "baseDir": "packages/app2",
                "dependencyInstallCommand": "cd ../.. && npm install",
                "webBuildCommand": "cd ../.. && npm run build --workspace=app2"
            }
        ]
    }
}

Yarn

If you are using Yarn as your package manager, you can specify the dependency install command as follows:

{
    "cloud": {
        "apps": [
            {
                "appId": "your-app-id",
                "dependencyInstallCommand": "yarn install",
                "webBuildCommand": "yarn build"
            }
        ]
    }
}