Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Use basepath in s3 assets #2265

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ export class NextJSLambdaEdge extends Construct {
);

const assetsDirectory = path.join(props.serverlessBuildOutDir, "assets");
const assets = readAssetsDirectory({ assetsDirectory });
const { basePath } = this.routesManifest || {};
const normalizedBasePath = basePath && basePath.length > 0 ? basePath.slice(1) : "";
const assets = readAssetsDirectory({ assetsDirectory: path.join(assetsDirectory, normalizedBasePath) });

// This `BucketDeployment` deploys just the BUILD_ID file. We don't actually
// use the BUILD_ID file at runtime, however in this case we use it as a
Expand Down