Skip to content

Commit

Permalink
fix(nextjs-cdk-construct): use basepath in s3 assets (#2265)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert van Kempen committed Jan 19, 2022
1 parent aab033f commit cf780e9
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit cf780e9

Please sign in to comment.