Skip to content

Configure Web Build Script

When building native apps with Capawesome Cloud, the platform needs to generate your web assets before creating the native builds. This guide explains how Capawesome Cloud determines which npm script to use for building your web application.

Build Script Priority

Capawesome Cloud follows a specific priority order when determining which script to execute for generating your web build:

  1. capawesome:build script: If defined in your package.json, this script will be used.
  2. build script: If capawesome:build is not defined, the standard build script will be used.
  3. Build failure: If neither script exists, the web build will fail.

For most projects, the standard build script is sufficient:

{
  "scripts": {
    "build": "ionic build"
  }
}

If you need different build configurations for Capawesome Cloud builds versus local builds, define a capawesome:build script:

{
  "scripts": {
    "build": "ionic build",
    "capawesome:build": "ionic build --prod"
  }
}

This is useful when you need to apply production-specific optimizations, enable different build flags, or run additional build steps for native apps.

Configuration File Override

You can also explicitly configure the web build command in your capawesome.config.json file:

{
  "cloud": {
    "apps": [
      {
        "appId": "your-app-id",
        "webBuildCommand": "npm run custom-build"
      }
    ]
  }
}

This approach gives you complete control over the build command and takes precedence over the automatic script detection. Learn more about configuration options in the App Configuration documentation.