@static

Configure the static asset S3 bucket.

Syntax

  • No parameters are required; @static is implied if @http is defined
  • folder defines the folder to upload static assets from. Default is public
  • fingerprint enables static asset file fingerprinting (and long-lived caching headers)
  • ignore defines which assets to be ignored during upload

Example

This app.arc file defines a static bucket:

arc
@app
testapp

@static
fingerprint true
ignore
  .tar.gz
  tmp
  user
json
{
  "app": "testapp",
  "static": {
    "fingerprint": true,
    "ignore": [
      ".tar.gz",
      "tmp",
      "user"
    ]
  }
}
toml
app="testapp"

[static]
fingerprint=true
ignore=[
  ".tar.gz",
  "tmp",
  "user"
]

yaml
---
app: testapp

static:
  fingerprint: true
  ignore:
    - ".tar.gz"
    - "tmp"
    - "user"

Deployment

arc deploy --static deploys static assets to staging from public/ or configured folder. arc deploy production --static deploys static assets to production from public/ or configured folder.

Static assets will also be uploaded during an arc deploy along with your function code.

arc deploy static --delete deletes static assets from the S3 bucket that are not present in the configured static asset folder.

arc deploy static --prune is an alias to delete.