Configuring Static Website Services with flightcontrol.json

Static Web Service Attributes

The type for all database services is static, and should be specified like the following:

type: 'static'

Common Service Configuration

Before configuring the service-specific options below, you should review the Common Service Configuration that applies to all service types. This includes important settings for:

  • Name
  • Environment variables
  • Build configuration
  • Watch paths
  • And more…

Static-Specific Options

The following attributes are specific to static web services:

Install, Build, and Post Build Commands

basePath: string

  • Example: "basePath": "./apps/frontend"
  • Optional, defaults to .
  • The directory containing your application code, relative to the repository root
  • Allows you to specify in which folder the following build commands should run

installCommand: string

  • Example: "installCommand": "./install.sh"
  • Optional, intelligent default based on your language and framework detected at the basePath
  • What we use to install dependencies for your build

buildCommand: string

  • Example: "buildCommand": "blitz build"
  • Optional, intelligent default based on your language and framework detected at the basePath
  • What we use to build your app

postBuildCommand: string

  • Example: "postBuildCommand": "./postBuildCommand.sh"
  • Optional, Empty by Default
  • Used as a build hook to run any operation after your build is complete
  • Note: buildCommand must be set for postBuildCommand to be used

Output Directory

outputDirectory: string

  • Example: "outputDirectory": "web/dist"
  • Optional with default: "public"
  • Relative to the configured basePath. If base path is web and built files are at web/dist, then output directory should be set to dist
  • All the files in this directory will be served statically via the CloudFront Content Delivery Network (CDN)

Domain

domain: string

  • Example: "domain": "www.example.com"
  • Optional, defaults to a random url like 123456789.cloudfront.net
  • Wildcard domains are supported: "domain": "*.example.com" The http host header will contain the specific domain that’s being used.
  • See our recommendation and detailed setup info for custom domains

Single Page Application

singlePageApp: boolean

  • Example: "singlePageApp": true
  • Optional with default: false
  • When true, all routes will load your root / page.
  • This should be enabled for sites like create-react-app and Redwood, but not for static site generators like Next.js, Gatsby, etc.

Version History Count

versionHistoryCount: number

  • Example: "versionHistoryCount": 5
  • Optional with default: 10
  • Number of previous versions to keep for rollback purposes

Integrations

integrations: object

Under the integrations key, you can configure integrations with third-party services. At this time, the only supported integration is with Sentry.

Upload Sentry Source Maps

uploadSentrySourceMap: boolean

  • Example: "integrations": { "uploadSentrySourceMap": true }
  • Optional with default: false
  • Enables uploading source maps to Sentry. This is useful for debugging errors in production. For more, see our Sentry guide.