UNPKG

@froxz/vite-plugin-s3

Version:

Allows you to upload files to AWS S3 or any other S3 compatible provider

46 lines (42 loc) 1.26 kB
import { Plugin } from 'vite'; import { S3ClientConfig, PutObjectRequest as PutObjectRequest$1 } from '@aws-sdk/client-s3'; export { S3ClientConfig } from '@aws-sdk/client-s3'; declare type PutObjectRequest = Omit<PutObjectRequest$1, 'Body' | 'Key'>; type Function = (subject: string) => boolean; type Pattern = string | RegExp | Function; type ContentPattern = Pattern | Pattern[] | null; /** * Plugin options. */ interface Options { /** * A Pattern to match for excluded content. */ exclude?: ContentPattern; /** * A Pattern to match for included content. */ include?: ContentPattern; /** * Provide the namespace of uploaded files on S3 */ basePath?: string | null; /** * Options for upload options of S3ClientConfig */ clientConfig: S3ClientConfig; /** * Provide upload options PutObjectRequest */ uploadOptions: PutObjectRequest; /** * By default: `build.outDir`. */ directory?: string | null; /** * If true, files will be uploaded sequentially. */ sequentialUploads?: boolean; } declare function ViteS3(enabled: boolean, userOptions: Options): Plugin; export { type Options, type PutObjectRequest, ViteS3 as S3Plugin, ViteS3 };