open-next-cdk
Version:
Deploy a NextJS app using OpenNext packaging to serverless AWS using CDK
52 lines (51 loc) • 1.84 kB
TypeScript
import { Construct } from 'constructs';
import { CompressionLevel, NextjsBaseProps } from './NextjsBase';
export interface NextjsBuildProps extends NextjsBaseProps {
}
/**
* Represents a built NextJS application.
* This construct runs `npm build` in standalone output mode inside your `nextjsPath`.
* This construct can be used by higher level constructs or used directly.
*/
export declare class NextjsBuild extends Construct {
/**
* Contains code for middleware. Not currently used.
*/
nextMiddlewareFnDir?: string;
/**
* Contains server code and dependencies.
*/
nextServerFnDir: string;
/**
* Contains function for processessing image requests.
* Should be arm64.
*/
nextImageFnDir: string;
/**
* Static files containing client-side code.
*/
nextStaticDir: string;
props: NextjsBuildProps;
readonly openNextPath: string;
constructor(scope: Construct, id: string, props: NextjsBuildProps);
private runNpmBuild;
readPublicFileList(): string[];
private _getNextBuildDir;
private _getOutputDir;
private _getNextStaticDir;
}
export interface CreateArchiveArgs {
readonly compressionLevel?: CompressionLevel;
readonly directory: string;
readonly zipFileName: string;
readonly zipOutDir: string;
readonly fileGlob?: string;
readonly quiet?: boolean;
}
export declare function createArchive({ directory, zipFileName, zipOutDir, fileGlob, compressionLevel, quiet, }: CreateArchiveArgs): string | null;
export declare function getBuildCmdEnvironment(siteEnvironment?: {
[key: string]: string;
}): Record<string, string>;
export declare const TOKEN_PLACEHOLDER_BEGIN = "{NEXT{! ";
export declare const TOKEN_PLACEHOLDER_END = " !}}";
export declare const makeTokenPlaceholder: (value: string) => string;