cdk-nextjs-standalone
Version:
Deploy a NextJS app to AWS using CDK and OpenNext.
81 lines (80 loc) • 2.32 kB
TypeScript
import { Construct } from 'constructs';
import type { NextjsProps } from './Nextjs';
export interface NextjsBuildProps {
/**
* @see {@link NextjsProps.buildCommand}
*/
readonly buildCommand?: NextjsProps['buildCommand'];
/**
* @see {@link NextjsProps.buildPath}
*/
readonly buildPath?: NextjsProps['buildPath'];
/**
* @see {@link NextjsProps.environment}
*/
readonly environment?: NextjsProps['environment'];
/**
* @see {@link NextjsProps.nextjsPath}
*/
readonly nextjsPath: NextjsProps['nextjsPath'];
/**
* @see {@link NextjsProps.quiet}
*/
readonly quiet?: NextjsProps['quiet'];
/**
* @see {@link NextjsProps.skipBuild}
*/
readonly skipBuild?: NextjsProps['skipBuild'];
/**
* @see {@link NextjsProps.streaming}
*/
readonly streaming?: NextjsProps['streaming'];
}
/**
* Build Next.js app.
*/
export declare class NextjsBuild extends Construct {
/**
* Contains server code and dependencies.
*/
get nextServerFnDir(): string;
/**
* Contains function for processessing image requests.
* Should be arm64.
*/
get nextImageFnDir(): string;
/**
* Contains function for processing items from revalidation queue.
*/
get nextRevalidateFnDir(): string;
/**
* Contains function for inserting revalidation items into the table.
*/
get nextRevalidateDynamoDBProviderFnDir(): string;
/**
* Static files containing client-side code.
*/
get nextStaticDir(): string;
/**
* Cache directory for generated data.
*/
get nextCacheDir(): string;
props: NextjsBuildProps;
constructor(scope: Construct, id: string, props: NextjsBuildProps);
/**
* Validate required paths/files for NextjsBuild
*/
private validatePaths;
private build;
/**
* Gets environment variables for build time (when `open-next build` is called).
* Unresolved tokens are replace with placeholders like {{ TOKEN_NAME }} and
* will be resolved later in `NextjsBucketDeployment` custom resource.
*/
private getBuildEnvVars;
readPublicFileList(): string[];
private assertBuildDirExists;
private getNextBuildDir;
private warnIfMissing;
private mockNextBuildDir;
}