When pathPrefix is set on the StacBrowser construct, the build correctly bakes the prefix into the app's publicPath but I think the files in BucketDeployment get uploaded to the root regardless of what pathPrefix is set to.
We have to rewrite the path downstream in order to properly serve anything in the bucket behind the prefix path.
so the proposed change would be something like:
this.bucketDeployment = new s3_deployment.BucketDeployment(this, 'BucketDeployment', {
destinationBucket: this.bucket,
destinationKeyPrefix: props.pathPrefix?.replace(/^\/+|\/+$/g, ''),
sources: [s3_deployment.Source.asset(buildPath)],
memoryLimit: 1024,
ephemeralStorageSize: Size.mebibytes(1024),
});
Acceptance Criteria
When
pathPrefixis set on the StacBrowser construct, the build correctly bakes the prefix into the app's publicPath but I think the files in BucketDeployment get uploaded to the root regardless of what pathPrefix is set to.We have to rewrite the path downstream in order to properly serve anything in the bucket behind the prefix path.
so the proposed change would be something like:
Acceptance Criteria
destinationKeyPrefixis set to matchpathPrefixwhen it's providedpathPrefixisn't set