Embed Assets
@klotho::embed_assets
Specified anywhere within a file.
For more information about embed assets, visit our embed assets concept page.
Directives
Directive | Type | Description | |
---|---|---|---|
id | string | (Required) The name of the embeded assets annotation. | |
include | string[] | (Optional) Files to include within the execution unit. Glob patterns (* and ** ) are supported. | |
exclude | string[] | (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:
- Include our
index.html
and any nested json files in the project. - Exclude our
/src/local/config.json
file.