Skip to content

Commit

Permalink
static-site: add assets.keepOldFiles option (#1062)
Browse files Browse the repository at this point in the history
* static-site: add assets.keepOldFiles option

* sync

---------

Co-authored-by: Frank <[email protected]>
  • Loading branch information
paolostyle and fwang committed Sep 19, 2024
1 parent 9b7a6a7 commit a55d811
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion platform/src/components/aws/static-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,19 @@ export interface StaticSiteArgs extends BaseStaticSiteArgs {
* ```
*/
path?: Input<string>;
/**
* Configure if files from previous deployments should be purged from the bucket.
* @default `true`
* @example
* ```js
* {
* assets: {
* purge: false
* }
* }
* ```
*/
purge?: Input<boolean>;
}
>;
/**
Expand Down Expand Up @@ -632,6 +645,7 @@ export class StaticSite extends Component implements Link.Linkable {
v.replace(/^\//, "").replace(/\/$/, ""),
)
: undefined,
purge: args.assets?.purge ?? true,
};
}

Expand Down Expand Up @@ -727,7 +741,7 @@ export class StaticSite extends Component implements Link.Linkable {
{
bucketName,
files: bucketFiles,
purge: true,
purge: assets.purge,
},
{ parent },
);
Expand Down

0 comments on commit a55d811

Please sign in to comment.