Skip to main content

Embed Assets

@klotho::embed_assets

Specified anywhere within a file.

For more information about embed assets, visit our embed assets concept page.

Directives

DirectiveTypeDescription
idstring(Required) The name of the embeded assets annotation.
includestring[](Optional) Files to include within the execution unit. Glob patterns (* and **) are supported.
excludestring[](Optional) Files to exclude from the execution unit. Glob patterns (* and **) are supported.
note

The exclude directive takes precedence over the include directive. If a file matches both the include and exclude patterns, it will be excluded from the execution unit.

All paths specified in the include and exclude directive must be an absolute path, from the klotho compilation root, or a relative path from the file where the annotation lives.

Examples

This specifies assets to embed within the execution units that contain the file embed.ts.

embed.ts
/**
* @klotho::embed_assets {
* id = "static-assets"
* include = ["index.html", "/**/*.json"]
* exclude = ["/src/local/config.json"]
* }
*/

This annotation will:

  1. Include our index.html and any nested json files in the project.
  2. Exclude our /src/local/config.json file.