Skip to content

App Configuration

Capawesome Cloud allows you to optionally define your app configuration in a capawesome.config.json file for advanced use cases such as monorepos, subdirectory apps, or custom build commands. By default, Capawesome Cloud uses sensible defaults that work for standard project setups.

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. This is the directory that Capawesome Cloud uses to build the app from. All commands including dependencyInstallCommand and webBuildCommand are called from this location. If left unset, Capawesome Cloud defaults to the root of the Git repository.
  • 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"
            }
        ]
    }
}

pnpm

If you are using pnpm as your package manager, you must install pnpm before running pnpm install:

{
    "cloud": {
        "apps": [
            {
                "appId": "your-app-id",
                "dependencyInstallCommand": "npm install -g pnpm && pnpm install",
                "webBuildCommand": "pnpm build"
            }
        ]
    }
}

Yarn

If you are using Yarn as your package manager, you must install Yarn before running yarn install:

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