Configuring Static Website Services with flightcontrol.json
In addition to the Service Configuration attributes that are common to all services, the following attributes are specific to static web site services.
Static Web Site Service Attributes
The type for all database services is static
, and should be specified like the following:
type: 'static'
In addition, there are several other attributes that are specific to static web services:
Install, Build, and Post Build Commands
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
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 httphost
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.
Output Directory
outputDirectory: string
- Example:
"outputDirectory": "web/dist"
- Optional with default:
"public"
- Relative to repository root, regardless of the base path setting
- All the files in this directory will be served statically via the CloudFront Content Delivery Network (CDN)
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 (opens in a new tab).
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.