UNPKG

@invisit/webpack-aws-lambda-auto-deploy-plugin

Version:

Uploads compiled assets to s3 after build

32 lines (31 loc) 956 B
import type AWS from "aws-sdk"; export declare type AutoDeployStorage = "lambda" | "s3"; /** * Map outputs to lambda function names */ export interface EntryLambdaMapping { fn: string[]; entry: string; } export declare type AWSLambdaStorage<Storage extends AutoDeployStorage> = { config?: Partial<AWS.Config>; } & (Storage extends "s3" ? { bucket: string; /** * Defaults to "", can not start with `/` */ pathPrefix?: string; /** * This is prepended to the base file name, * which is `<pathPrefix>/?<namePrefix>[entry].YYYYMMDDHHmmss.zip` * * plugin will ensure a slash between `pathPrefix` and `name` if `pathPrefix` * is not empty */ namePrefix?: string; } : {}); export declare type AWSLambdaAutoDeployPluginConfig<Storage extends AutoDeployStorage = "lambda"> = { aws?: AWSLambdaStorage<Storage>; mappings: string | EntryLambdaMapping[]; preDeployScript?: string; };