import { Plugin } from 'vite'; /** * Configuration options for the R2 deployment plugin */ export interface R2DeployOptions { /** R2 endpoint URL */ endpoint: string; /** R2 access key ID */ accessKeyId: string; /** R2 secret access key */ secretAccessKey: string; /** Public bucket URL for accessing uploaded files */ publicBucketUrl: string; /** Path within the bucket where files will be uploaded (e.g., 'apps/vowel/shopify') */ bucketPath: string; /** Files to upload - array of { source: string, contentType: string } */ files: Array<{ /** Source file path or glob pattern relative to project root */ source: string; /** Content type (defaults to 'application/javascript') */ contentType?: string; /** Also upload this file with the specified filename (without hash) */ uploadAsLatest?: string; }>; /** Whether to enable deployment (defaults to true) */ enabled?: boolean; /** Whether to clean up old versioned files (defaults to false) */ cleanOldVersions?: boolean; /** Number of old versions to keep (defaults to 5) */ keepVersions?: number; } /** * Creates a Vite plugin that deploys files to Cloudflare R2 after build * * @param options - Configuration options for R2 deployment * @returns Vite plugin * * @example * ```ts * export default defineConfig({ * plugins: [ * r2Deploy({ * endpoint: process.env.R2_ENDPOINT!, * accessKeyId: process.env.R2_ACCESS_KEY_ID!, * secretAccessKey: process.env.R2_SECRET_ACCESS_KEY!, * publicBucketUrl: process.env.R2_PUBLIC_BUCKET_URL!, * bucketPath: 'apps/vowel', * files: [ * { * source: 'dist/vowel-voice-widget-*.min.js', * contentType: 'application/javascript', * uploadAsLatest: 'vowel-voice-widget.min.js' * }, * { * source: 'dist/vowel-voice-widget-*.min.js.map', * contentType: 'application/json' * } * ], * cleanOldVersions: true, * keepVersions: 5 * }) * ] * }); * ``` */ export declare function r2Deploy(options: R2DeployOptions): Plugin; //# sourceMappingURL=vite-plugin-r2-deploy.d.ts.map