From a55d811dac83e9148bc48be7bdb5a89feacad773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20D=C4=85browski?= Date: Thu, 19 Sep 2024 23:11:37 +0200 Subject: [PATCH] static-site: add assets.keepOldFiles option (#1062) * static-site: add assets.keepOldFiles option * sync --------- Co-authored-by: Frank --- platform/src/components/aws/static-site.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/platform/src/components/aws/static-site.ts b/platform/src/components/aws/static-site.ts index 4357867da..09a94f74c 100644 --- a/platform/src/components/aws/static-site.ts +++ b/platform/src/components/aws/static-site.ts @@ -277,6 +277,19 @@ export interface StaticSiteArgs extends BaseStaticSiteArgs { * ``` */ path?: Input; + /** + * Configure if files from previous deployments should be purged from the bucket. + * @default `true` + * @example + * ```js + * { + * assets: { + * purge: false + * } + * } + * ``` + */ + purge?: Input; } >; /** @@ -632,6 +645,7 @@ export class StaticSite extends Component implements Link.Linkable { v.replace(/^\//, "").replace(/\/$/, ""), ) : undefined, + purge: args.assets?.purge ?? true, }; } @@ -727,7 +741,7 @@ export class StaticSite extends Component implements Link.Linkable { { bucketName, files: bucketFiles, - purge: true, + purge: assets.purge, }, { parent }, );